[SERVER-16966] Error 10053 when combining inclusion and exclusion semantics in a single projection Created: 21/Jan/15  Updated: 07/Apr/23  Resolved: 21/Jan/15

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

Type: Bug Priority: Major - P3
Reporter: Ezequiel Primo Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File ErrorQueries    
Operating System: ALL
Participants:

 Description   

error: {
"$err" : "You cannot currently mix including and excluding fields. Contact us if this is an issue.",
"code" : 10053
}



 Comments   
Comment by Ramon Fernandez Marina [ 22/Jan/15 ]

You're welcome ezequi. If you think there's room for improvement in the documentation for query projection please let us know.

Comment by Ezequiel Primo [ 22/Jan/15 ]

Thanks a lot, didn't see that info in detail, I also tried for the java driver and should be the same right.
Now it is completely clear,
Regards,

Comment by Ramon Fernandez Marina [ 21/Jan/15 ]

ezequi, please see the documentation on limiting fields returned from a query, specifically:

You cannot combine inclusion and exclusion semantics in a single projection with the exception of the _id field.

This query:

db.test.find({"family" : "Smith"},{"children" : 1, "family" : 0,"_id":0})

is incorrect. Try:

db.test.find({"family" : "Smith"},{"children" : 1, "_id":0})

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