Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
look inside indexed arrays for regexes fix for SERVER-2247
- Loading branch information
gregs
committed
Apr 6, 2011
1 parent
a3b7bb6
commit 9193ff5
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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() ) | ||
|
||
|