发布于 2015-09-14 14:54:31 | 109 次阅读 | 评论: 0 | 来源: 网络整理
In addition to the MongoDB Query Operators, there are a number of “meta” operators that you can modify the output or behavior of a query. On the server, MongoDB treats the query and the options as a single object. The mongo shell and driver interfaces may provide cursor methods that wrap these options. When possible, use these methods; otherwise, you can add these options using either of the following syntax:
db.collection.find( { <query> } )._addSpecial( <option> )
db.collection.find( { $query: { <query> }, <option> } )
Many of these operators have corresponding methods in the shell. These methods provide a straightforward and user-friendly interface and are the preferred way to add these options.