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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.1.7
    • Fix Version/s: 3.1.8
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      QuInt 8 08/28/15

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: