schema.findOne(function (document) {
if(condition on document) {
return true; //Yes select this element
}
else {
return false; // No don't select this document
}
});
schema.findOne({$where: "return (condition on this);"});
--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongoose-orm/e3f0db25-474f-4a1e-af33-9c0a0c34982e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.