HDallakyan
HDallakyan

Reputation: 748

React get data from MongoDB

I have an express app and react, express connected to react with proxy. I have added data to mongodb from express

var HeaderSection = require('../../models/sections/header_SC');
var mongoose = require('mongoose');

var headerSc = [
    new HeaderSection ({
        imagePath:
            '',
        title:
            'Odelia Revivo',
        description:
            '- Makeup Artist -',
        buttonText:
            'צרו קשר'
})];

How can I get this data from React?

Upvotes: 0

Views: 339

Answers (1)

Mohd Sheeraz
Mohd Sheeraz

Reputation: 343

You can use HeaderSection.find({your query here}) to fetch the data from the MongoDB

Upvotes: 2

Related Questions