Scoopster
unread,Feb 11, 2012, 2:51:57 AM2/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mongoose Node.JS ORM
Is there a way to log all the queries fired by Mongoose towards
mongodb? I can see how it'll be very useful as a debugging tool.
I'm also running into this issue and any pointers to help me debug
would be very helpful:
var comments = new Schema ({
userId : { type: Schema.ObjectId, ref: 'User' }
, postId : { type: Schema.ObjectId, ref: 'post' }
, text : String
});
And I'm trying something like:
var objId = new mongoose.Types.ObjectId("4efd45859b9ca8a01c000016");
commentsModel.find( {userId: objId} } , function (err, doc){
This kind of lookup is not working for any field that is and ObjectId.
The same works from the mongo console.
I've tried all I can but fail to understand why the query doesn't
select any results. If can Iog the query that goes to Mongo, then I
may be able to see whether it's a user error or mongoose issue or
something else.
Any help would be awesome.
Thanks