< }.property() }); })();

MongoDB - IssueTracker - Trouble returning documents with db.collection.find()

MongoDB - IssueTracker - Trouble returning documents with db.collection.find()
0

#1

Hi. I’m working on the issue tracker project and having trouble getting my db.collection methods to work. For instance, right now I’m trying to execute a find operation.

db.collection('issues').find({_id:ObjectId(req.body._id)},(err,data)=>{
        if (err){console.log(err);res.send('could not update '+data._id)}
        res.json(data);

I’m expecting the operation to return a document from my collection. The _id I’m passing definitely matches one of them. Instead, when I console log the returned data in my callback, I’m getting an object with properties named pool, server, disconnectHandler, bson, ns …and a bunch more stuff I’m not interested in. I have MongoClient and ObjectID required.

Does this type of response to a find() request look familiar to anyone?