I am running through a tutorial I found online for Node.js and Mongo DB which provides the following code:
collection.find({},{},function(e,docs){
res.render('userlist', {
"userlist" : docs
});
});
For searching a mongo DB database for all users. The code works fine, however when I tried to modify it to
collection.find({'username': "testuser1"},{},function(e,docs){
res.render('userlist', {
"userlist" : docs
});
});
In order to get one specific user, I am still getting all results.
If I enter that same collection.find() command in to the mongo console, it returns a single result as expected.
What's going on?