summaryrefslogtreecommitdiff
path: root/jstests/geo_withinquery.js
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-03-03 15:04:57 -0500
committerRandolph Tan <randolph@10gen.com>2014-03-03 15:29:00 -0500
commitf8534ae0d6c4e252d169c5bcf42f42cf6518ee7d (patch)
treee35db08d5d7ea3d70b6925f30bec0881efd2ee83 /jstests/geo_withinquery.js
parent6a10de0bb8fe996daca5ecd5687f1072abb0dd8b (diff)
downloadmongo-f8534ae0d6c4e252d169c5bcf42f42cf6518ee7d.tar.gz
SERVER-12127 migrate js tests to jscore suite when not related to writes
Temporarily put back jstest in order not to lose test coverage
Diffstat (limited to 'jstests/geo_withinquery.js')
-rw-r--r--jstests/geo_withinquery.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/geo_withinquery.js b/jstests/geo_withinquery.js
new file mode 100644
index 00000000000..11701d34c62
--- /dev/null
+++ b/jstests/geo_withinquery.js
@@ -0,0 +1,15 @@
+// SERVER-7343: allow $within without a geo index.
+t = db.geo_withinquery;
+t.drop();
+
+num = 0;
+for ( x=0; x<=20; x++ ){
+ for ( y=0; y<=20; y++ ){
+ o = { _id : num++ , loc : [ x , y ] }
+ t.save( o )
+ }
+}
+
+assert.eq(21 * 21 - 1, t.find({ $and: [ {loc: {$ne:[0,0]}},
+ {loc: {$within: {$box: [[0,0], [100,100]]}}},
+ ]}).itcount(), "UHOH!")