[SERVER-23737] document validation, $exists:1 works, $exists:0 not so much Created: 14/Apr/16 Updated: 22/Apr/16 Resolved: 15/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 3.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Daniel Farrell | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: |
|
| Participants: |
| Description |
|
3.2.4 on Centos 7, mongo ---- this first code works as expected -------------------
---- this code does not work, allows insert -------------
|
| Comments |
| Comment by Daniel Farrell [ 22/Apr/16 ] | |||||||||||||||||||||||||||||
|
Thanks Dan ! – Please advise a newbie .. Should I create a new ticket- Why did my original request for a document validator pass, return Ok ? | |||||||||||||||||||||||||||||
| Comment by Daniel Pasette (Inactive) [ 15/Apr/16 ] | |||||||||||||||||||||||||||||
|
There's are a couple issues with your test code. The main thing though is that your call to createCollection is not valid. I don't understand how your first sample would have worked. I've pasted a version that fails to insert the document containing the field k1, as I believe is the intent.
To check the validator on your collection run db.getCollectionInfos(). In this case you'll see the following:
|