发布于 2015-09-14 15:13:19 | 83 次阅读 | 评论: 0 | 来源: 网络整理

$query

The $query operator provides an interface to describe queries. Consider the following operation:

db.collection.find( { $query: { age : 25 } } )

This is equivalent to the following db.collection.find() method that may be more familiar to you:

db.collection.find( { age : 25 } )

These operations return only those documents in the collection named collection where the age field equals 25.

注解

Do not mix query forms. If you use the $query format, do not append cursor methods to the find(). To modify the query use the meta-query operators, such as $explain.

Therefore, the following two operations are equivalent:

db.collection.find( { $query: { age : 25 }, $explain: true } )
db.collection.find( { age : 25 } ).explain()
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务