[SERVER-14160] Cannot project subfield of _id Created: 04/Jun/14  Updated: 06/Dec/22  Resolved: 15/Mar/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.4.10, 2.6.1
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: John Page Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-7502 Query's projection does not obey part... Closed
Assigned Teams:
Query
Participants:

 Description   

if _id is an object you cannot project out on of it's members in a normal projection, you can using $project in aggregation

> db.foo.insert({_id:{a:1,b:1}})
WriteResult({ "nInserted" : 1 })
> db.foo.find({},{_id:0,"_id.a":1})
{  }



 Comments   
Comment by J Rassi [ 04/Jun/14 ]

Confirmed on 2.4.10 and 2.6.1, assigning to hari.khalsa@10gen.com for triage.

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