Skip to content

Commit

Permalink
Clarify minimongo fields docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava committed Oct 1, 2013
1 parent b28c817 commit 60dd2c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/client/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1261,12 +1261,13 @@ <h2 id="meteor_collection_cursor"><span>Cursors</span></h2>
// Users.find({}, {fields: {password: 0, hash: 0}})

To return an object that only includes the specified field, use `1` as
the value. The `_id` field is still included in the result.
the value. The `_id` field is still included in the result.

// Users.find({}, {fields: {firstname: 1, lastname: 1}})

It is not possible to mix inclusion and exclusion styles (exception for `_id`).
Field operators such as `$` and `$elemMatch` are not available on client side yet.
It is not possible to mix inclusion and exclusion styles (except for the cases
when `_id` is included by default or explicitly included). Field operators such
as `$` and `$elemMatch` are not available on the client side yet.

More advanced example:

Expand All @@ -1278,7 +1279,8 @@ <h2 id="meteor_collection_cursor"><span>Cursors</span></h2>

// returns { alterEgos: [{ name: "Kira" }, { name: "L" }] }

Notice the nested field rule and array behavior, learn more in MongoDB docs.
See <a href="http://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/#projection">
the MongoDB docs</a> for details of the nested field rules and array behavior.

{{/api_box_inline}}

Expand Down

0 comments on commit 60dd2c8

Please sign in to comment.