summaryrefslogtreecommitdiff
path: root/jstests/geo_distinct.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/geo_distinct.js')
-rw-r--r--jstests/geo_distinct.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/geo_distinct.js b/jstests/geo_distinct.js
new file mode 100644
index 0000000..60e0d15
--- /dev/null
+++ b/jstests/geo_distinct.js
@@ -0,0 +1,16 @@
+// Test distinct with geo queries SERVER-2135
+
+t = db.commits
+t.drop()
+
+t.save( { _id : ObjectId( "4ce63ec2f360622431000013" ), loc : [ 55.59664, 13.00156 ], author : "FredrikL" } )
+
+printjson( db.runCommand( { distinct : 'commits', key : 'loc' } ) )
+assert.isnull( db.getLastError() )
+
+t.ensureIndex( { loc : '2d' } )
+
+printjson( t.getIndexes() )
+
+printjson( db.runCommand( { distinct : 'commits', key : 'loc' } ) )
+assert.isnull( db.getLastError() ) \ No newline at end of file