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

Modify stageDebug command to strip field names from startKey and endKey parameters

    • Fully Compatible
    • QuInt 8 08/28/15

      Some of the stageDebug JS tests are flawed because they use duplicate property definitions:

      // NB: The startKey object below will only have one key, {'': MinKey}, despite the intent of this test
      ixscan1 = {ixscan: {args:{keyPattern:{foo:1, baz: 1},
                                startKey: {"": 20, "":MinKey},
                                endKey: {"" : 30, "":MaxKey}, endKeyInclusive: true,
                                direction: 1},
                          filter: {baz: 25}}};
      res = db.runCommand({stageDebug: {collection: collname, plan: ixscan1}});
      

      One potential fix would be to accept arrays of values for the startKey and endKey parameters.

      Here's Max's comment from SERVER-19325:

      ...fixing these tests (and preserving their intent) requires changing the stageDebug command to accept startKey and endKey as arrays. The mongo shell has no way to guarantee an order for object keys, so using stripFieldNames() is not an effective solution. Enabling the mongo shell to query using ranges of a compound index with the stageDebug command will be done separately.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: