Is it possible to use function in MongoDB $where clause? -
i need find out if possible use function in $where clause string this:
db.mycollection.find( "this.name == 'xyz' || function() {return 1>0;} || this.name == 'abc'" );
thanks in advance.
i'm not quite sure you're trying do, put checks in single function that's value of $where
:
db.mycollection.find({$where: function() { return this.name == 'xyz' || 1>0 || this.name == 'abc'; }});
Comments
Post a Comment