Files
mongo/jstests/core/geo_regex0.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

19 lines
436 B
JavaScript

// From SERVER-2247
// Tests to make sure regex works with geo indices
t = db.regex0
t.drop()
t.ensureIndex( { point : '2d', words : 1 } )
t.insert( { point : [ 1, 1 ], words : [ 'foo', 'bar' ] } )
regex = { words : /^f/ }
geo = { point : { $near : [ 1, 1 ] } }
both = { point : { $near : [ 1, 1 ] }, words : /^f/ }
assert.eq(1, t.find( regex ).count() )
assert.eq(1, t.find( geo ).count() )
assert.eq(1, t.find( both ).count() )