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

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -