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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.0.7
    • 3.5.10
    • Shell
    • None
    • 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

              benety.goh@mongodb.com Benety Goh
              ankit.kakkar@mongodb.com Ankit Kakkar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: