Reputation: 1
I am using Gulp building system. When I try to connect to my local MongoDB
using mongoose
I got error mongoose.connect is not a function
.
Connection code:
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
Upvotes: 0
Views: 90
Reputation: 231
Your problem isn't that you're using mongoose directly in react ?
Mongoose is a node module: "elegant mongodb object modeling for node.js".
Upvotes: 0
Reputation: 28638
Your code seems fine. Are you sure you correctly installed mongoose?
npm install --save mongoose
Upvotes: 1