[DOCS-3855] Mistake in Projection doc Created: 01/Aug/14  Updated: 19/Aug/14  Resolved: 19/Aug/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.10

Type: Bug Priority: Major - P3
Reporter: William Cross Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 26 weeks, 1 day ago

 Description   

url: http://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/

in "Projection for Array Fields," it has the text: "The $elemMatch and $slice projection operators are the only way to project portions of an array."

This is not true; you can use dot notation. Run the following in the shell:

db.foo.insert( { a : [5, 6, 7, 8], b : [ 11, 12, 13, 14] } )
db.foo.find( { "a.2": 7 }, { _id : 0 , "a.$": 1 } )



 Comments   
Comment by Githook User [ 19/Aug/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3855 update array section in the projection tutorial
Branch: master
https://github.com/mongodb/docs/commit/43e1b6da732699fa13158c92e42af05a4f6894da

Generated at Thu Feb 08 07:46:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.