diff options
Diffstat (limited to 'jstests/core/projection_dotted_paths.js')
-rw-r--r-- | jstests/core/projection_dotted_paths.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/core/projection_dotted_paths.js b/jstests/core/projection_dotted_paths.js index 1f097b287f1..7f6eb1bfef2 100644 --- a/jstests/core/projection_dotted_paths.js +++ b/jstests/core/projection_dotted_paths.js @@ -38,7 +38,7 @@ assert(isIndexOnly(db, getWinningPlan(explain.queryPlanner))); // Project exactly the set of fields in the index but also include _id. Verify that the // projection is computed correctly and that the plan cannot be covered. resultDoc = coll.findOne({a: 1}, {_id: 1, a: 1, "b.c": 1, "b.d": 1, c: 1}); -assert.docEq(resultDoc, {_id: 1, a: 1, b: {c: 1, d: 1}, c: 1}); +assert.docEq({_id: 1, a: 1, b: {c: 1, d: 1}, c: 1}, resultDoc); explain = coll.find({a: 1}, {_id: 0, "b.c": 1, c: 1}).explain("queryPlanner"); explain = coll.find({a: 1}, {_id: 1, a: 1, "b.c": 1, "b.d": 1, c: 1}).explain("queryPlanner"); assert(isIxscan(db, getWinningPlan(explain.queryPlanner))); @@ -46,7 +46,7 @@ assert(!isIndexOnly(db, getWinningPlan(explain.queryPlanner))); // Project a not-indexed field that exists in the collection. The plan should not be covered. resultDoc = coll.findOne({a: 1}, {_id: 0, "b.c": 1, "b.e": 1, c: 1}); -assert.docEq(resultDoc, {b: {c: 1, e: 1}, c: 1}); +assert.docEq({b: {c: 1, e: 1}, c: 1}, resultDoc); explain = coll.find({a: 1}, {_id: 0, "b.c": 1, "b.e": 1, c: 1}).explain("queryPlanner"); assert(isIxscan(db, getWinningPlan(explain.queryPlanner))); assert(!isIndexOnly(db, getWinningPlan(explain.queryPlanner))); @@ -54,14 +54,14 @@ assert(!isIndexOnly(db, getWinningPlan(explain.queryPlanner))); // Project a not-indexed field that does not exist in the collection. The plan should not be // covered. resultDoc = coll.findOne({a: 1}, {_id: 0, "b.c": 1, "b.z": 1, c: 1}); -assert.docEq(resultDoc, {b: {c: 1}, c: 1}); +assert.docEq({b: {c: 1}, c: 1}, resultDoc); explain = coll.find({a: 1}, {_id: 0, "b.c": 1, "b.z": 1, c: 1}).explain("queryPlanner"); assert(isIxscan(db, getWinningPlan(explain.queryPlanner))); assert(!isIndexOnly(db, getWinningPlan(explain.queryPlanner))); // Verify that the correct projection is computed with an idhack query. resultDoc = coll.findOne({_id: 1}, {_id: 0, "b.c": 1, "b.e": 1, c: 1}); -assert.docEq(resultDoc, {b: {c: 1, e: 1}, c: 1}); +assert.docEq({b: {c: 1, e: 1}, c: 1}, resultDoc); explain = coll.find({_id: 1}, {_id: 0, "b.c": 1, "b.e": 1, c: 1}).explain("queryPlanner"); assert(isIdhack(db, getWinningPlan(explain.queryPlanner)), explain); |