[SERVER-21779] db.runCommand() should return error if second argument is invalid Created: 06/Dec/15 Updated: 06/Dec/17 Resolved: 28/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.0.7 |
| Fix Version/s: | 3.5.10 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ankit Kakkar | Assignee: | Benety Goh |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
Team, If we try to create index using misplaced background configuration, MongoDB should be able to validate and report back the error. For example, if I run following command, server doesn't tells me that background is placed wrong and instead runs the indexing in foreground:
Note that the background: true is not present per index level but is defined at global level. |
| Comments |
| Comment by Githook User [ 28/Jun/17 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: When the command object is passed in as the first argument, any non-empty 'extraKeys' |
| Comment by Githook User [ 28/Jun/17 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by J Rassi [ 07/Dec/15 ] |
|
The issue you're running into here is with the db.runCommand() shell helper, not with the createIndexes command. It is invalid to pass a non-empty second argument to the db.runCommand() shell helper if the first argument has a non-string type. The shell helper should return an error if this happens, instead of silently ignoring the second argument. Updated ticket summary accordingly. See also linked ticket |