Query.prototype.$where()
Parameters
- js «String|Function» javascript string or function
Returns:
- «Query» this
Specifies a javascript function or expression to pass to MongoDBs query system.
Example
query.$where('this.comments.length === 10 || this.name.length === 5')
// or
query.$where(function () {
return this.comments.length === 10 || this.name.length === 5;
})
NOTE:
Only use $where
when you have a condition that cannot be met using other MongoDB operators like $lt
. Be sure to read about all of its caveats before using.
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .