Skip to content

Instantly share code, notes, and snippets.

@zdwolfe
Created January 19, 2013 23:06
Show Gist options
  • Save zdwolfe/4575753 to your computer and use it in GitHub Desktop.
Save zdwolfe/4575753 to your computer and use it in GitHub Desktop.
find $or problem
models.User.find({ $or: [{"username":String(reqUsername)},{"email":String(reqEmail)}]}, function(err, user) {
console.log('user = ' + JSON.stringify(user));
});
@zdwolfe
Copy link
Author

zdwolfe commented Jan 19, 2013

This works:

db.users.find({ $or: [{'username':'curltestusername'},{'email':'curltestemail@foo.com'}]});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment