I\'m using MongoDb
(as part of MongoJS
) in Node
. Here is the documentation for MongoJS.
I\'m trying to do a call within Node based
Here's another way to utilise objectId when using mongoose.
// at the top of the file
const Mongoose = require('mongoose')
const ObjectId = Mongoose.Types.ObjectId;
// when using mongo to collect data
Mongoose.model('users', userSchema).findOne({ _id:
ObjectId('xyz') }, function (err, user) {
console.log(user)
return handle(req, res)
})
})