MongoDB: Can't canonicalize query: BadValue Projection cannot have a mix of inclusion and exclusion -
I am new to Mongodi with KHPHP.
When I write the following questions, then it will be executed very well.
db.testData.find () {"_id": ObjectId ("53d1f79db8173a625961ff3d"), "name": "sadikhasan", "created": ISODate ("2014-07-25T06: 22: 21.701Z "}} When I run the following query only to get the name, but this error shows
db.testData.find ({}, "Code": 17287} <{code} / Pre> When I run the following query to get names only with _id: 0 db.testData.find ({}, {Name: 1, _id: 0}) {"name": "sadikhasan"} My curation is that when I write created: 0 Thank you for helping in the advancement list.
You can not include included and exclusion, < Strong> only is the exception _id . For example if you have this:
If you want "name" and "date of birth", you should do so Required:
or this:
db.collection.find ({}, {"_id": 0, "created": 0}) But any other operation other than "_id" is not allowed to "mix"
db.collection.find ({}, { "_id": 0, "name": 1, "created": 0}) This creates an error in an Lso.
All this is included in.
Comments
Post a Comment