[SERVER-20099] Modify stageDebug command to strip field names from startKey and endKey parameters Created: 24/Aug/15  Updated: 19/Sep/15  Resolved: 25/Aug/15

Status: Closed
Project: Core Server
Component/s: Querying, Testing Infrastructure
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Improvement Priority: Minor - P4
Reporter: Kamran K. Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-19325 Remove duplicate properties from obje... Closed
Backwards Compatibility: Fully Compatible
Sprint: QuInt 8 08/28/15
Participants:

 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.



 Comments   
Comment by Githook User [ 25/Aug/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-20099 strip field names from startKey and endKey parameters to the ixscan stage in stageDebug

Also fixes js tests with duplicate property names.
Branch: master
https://github.com/mongodb/mongo/commit/2d5db8d45655e2939e695bfad25935e08c1a235b

Generated at Thu Feb 08 03:53:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.