-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 3.1.7
-
Component/s: Querying, Testing Infrastructure
-
None
-
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.
- is related to
-
SERVER-19325 Remove duplicate properties from objects in JS tests
- Closed