Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21779

db.runCommand() should return error if second argument is invalid

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.7
    • Fix Version/s: 3.5.10
    • Component/s: Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      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:

      db.runCommand({
      	createIndexes: "exampleIndex",
      	indexes: [{
      		key: {
      			a: 1,
      			b: 1,
      			"c": 1
      		},
      		name: "a_1_b_1_c_1"
      	},
      	{
      		key: {
      			a: 1,
      			b: 1,
      			c: 1,
      			"d": 1,
      			e: 1
      		},
      		name: "a_1_b_1_c_1_d_1_e_1"
      	}]
      },{ background: true })
      

      Note that the background: true is not present per index level but is defined at global level.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              ankit.kakkar Ankit Kakkar
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: