[SERVER-5334] Return one element from an array that match with the query Created: 19/Mar/12  Updated: 20/Mar/12  Resolved: 20/Mar/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Sebastien Balant Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by Eliot Horowitz (Inactive) [ 20/Mar/12 ]

See SERVER-828

Comment by Sebastien Balant [ 19/Mar/12 ]

I have a collection with an array.
I want to select one element of my collection that match with one element of the array and just return the element of the array.

Something like that:

db.foo.find({_id: objectId, 'objects._id': objectId }, {_id: 1, 'objects.$': 1})

Thanks

Generated at Thu Feb 08 03:08:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.