[SERVER-31337] db.collection.insert() shell helper does not support "bypassDocumentValidation" option Created: 29/Sep/17 Updated: 06/Dec/22 Resolved: 17/Dec/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.2.17, 3.4.9, 3.5.13 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kyle Suarez | 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: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Frustratingly, the db.collection.insert() shell helper silently ignores the "bypassDocumentValidation" flag. Fixing this problem is Harder Than It Sounds because the function uses the shell's Bulk API, which apparently does not have any notion of passing in options when performing an insert. I manually inspected the shell code back to v3.2 and I believe the issue has been present since when document validation was introduced. As a workaround, you can use db.runCommand to run the insert command directly and specify the option yourself. |
| Comments |
| Comment by Asya Kamsky [ 17/Dec/18 ] |
|
Duplicate of |
| Comment by Kyle Suarez [ 29/Sep/17 ] |
|
Marking documentation changes as "Needed" since the shell helper's docs page should be updated after this goes in. |