summaryrefslogtreecommitdiff
path: root/jstests/core/geo_2d_trailing_fields.js
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-12-19 17:43:50 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2017-12-28 11:01:26 -0500
commitf98cb60d80f281d3065b0282ed6f25b5f419ae1b (patch)
treeef3834ff588eaab6ff8382fa9f4bc74ebbff7d57 /jstests/core/geo_2d_trailing_fields.js
parente64b7e331649fd1d6beb83d981857ffd7ad6e539 (diff)
downloadmongo-f98cb60d80f281d3065b0282ed6f25b5f419ae1b.tar.gz
SERVER-1981 Support near and nearSphere predicates on sharded collections
Diffstat (limited to 'jstests/core/geo_2d_trailing_fields.js')
-rw-r--r--jstests/core/geo_2d_trailing_fields.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/jstests/core/geo_2d_trailing_fields.js b/jstests/core/geo_2d_trailing_fields.js
index 8f9c881ae4c..28ed715e858 100644
--- a/jstests/core/geo_2d_trailing_fields.js
+++ b/jstests/core/geo_2d_trailing_fields.js
@@ -5,18 +5,15 @@
const coll = db.geo_2d_trailing_fields;
const isMaster = assert.commandWorked(db.adminCommand({isMaster: 1}));
- const isMongos = (isMaster.msg === "isdbgrid");
coll.drop();
assert.commandWorked(coll.createIndex({a: "2d", b: 1}));
assert.writeOK(coll.insert({a: [0, 0]}));
// Verify that $near queries handle existence predicates over the trailing fields correctly.
- if (!isMongos) {
- assert.eq(0, coll.find({a: {$near: [0, 0]}, b: {$exists: true}}).itcount());
- assert.eq(1, coll.find({a: {$near: [0, 0]}, b: null}).itcount());
- assert.eq(1, coll.find({a: {$near: [0, 0]}, b: {$exists: false}}).itcount());
- }
+ assert.eq(0, coll.find({a: {$near: [0, 0]}, b: {$exists: true}}).itcount());
+ assert.eq(1, coll.find({a: {$near: [0, 0]}, b: null}).itcount());
+ assert.eq(1, coll.find({a: {$near: [0, 0]}, b: {$exists: false}}).itcount());
// Verify that non-near 2d queries handle existence predicates over the trailing fields
// correctly.
@@ -32,10 +29,8 @@
// Verify that $near queries correctly handle predicates which cannot be covered due to array
// semantics.
- if (!isMongos) {
- assert.eq(0, coll.find({a: {$near: [0, 0]}, "b.c": [2, 3]}).itcount());
- assert.eq(0, coll.find({a: {$near: [0, 0]}, "b.c": {$type: "array"}}).itcount());
- }
+ assert.eq(0, coll.find({a: {$near: [0, 0]}, "b.c": [2, 3]}).itcount());
+ assert.eq(0, coll.find({a: {$near: [0, 0]}, "b.c": {$type: "array"}}).itcount());
// Verify that non-near 2d queries correctly handle predicates which cannot be covered due to
// array semantics.