[SERVER-22216] Failed when using $exist false check on a embedded array Created: 18/Jan/16 Updated: 14/Apr/16 Resolved: 18/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | gabriel.wang | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
1) CentOS 7 |
||
| Operating System: | Linux |
| Steps To Reproduce: | 1) Create documents 2) Create query object, and return the number of documents which doesn't have the field: app.qos BSONObj query = BSON("app.qos"<<"{$exists:false}"); 3) Check the result of count. the counter=0 (It should return 1) 4) If run the shell command from command line, it return correctly. |
| Participants: |
| Description |
|
Two documents, (one has the array sub-doc: app.qos, the other doesn't have the array doc. could get the document which does has the array sub-document by query with {app.qos: $exist false}. ] { } |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 18/Jan/16 ] |
|
Hi Gabriel, Thanks for confirming this issue was due to incorrect query syntax. Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag where your questions will reach a large audience of MongoDB users, developers and enthusiasts. Regards, |
| Comment by gabriel.wang [ 18/Jan/16 ] |
|
sorry for my typo. |
| Comment by gabriel.wang [ 18/Jan/16 ] |
|
The log captured in mongod.log as below. [conn2] command xxx.$cmd command: count { count: "app", query: { app.qos: "{$exists:false}" } } planSummary: COLLSCAN keyUpdates:0 writeConflicts:0 numYields:459 reslen:44 locks:{ Global: { acquireCount: { r: 920 }}, Database: { acquireCount: { r: 460 }}, Collection: {acquireCount: { r: 460 }} } 1923ms |