diff options
author | Aaron <aaron@10gen.com> | 2009-05-08 15:42:50 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-05-08 15:42:50 -0700 |
commit | fb0746fda65ddf00536cd0b07c6c95ed86e521d9 (patch) | |
tree | 00458eac2485f0f91302a30defa26f2f590190fe /dbtests/querytests.cpp | |
parent | d0470d437ce66ed2f49760e7182ef47988159f7e (diff) | |
download | mongo-fb0746fda65ddf00536cd0b07c6c95ed86e521d9.tar.gz |
generate simplified key to match query with simple bounds
Diffstat (limited to 'dbtests/querytests.cpp')
-rw-r--r-- | dbtests/querytests.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dbtests/querytests.cpp b/dbtests/querytests.cpp index 36af257769f..7359fc28a40 100644 --- a/dbtests/querytests.cpp +++ b/dbtests/querytests.cpp @@ -610,6 +610,19 @@ namespace QueryTests { } const char *ns; }; + + class FastCountIn : public ClientBase { + public: + ~FastCountIn() { + client().dropCollection( "querytests.FastCountIn" ); + } + void run() { + const char *ns = "querytests.FastCountIn"; + client().insert( ns, BSON( "i" << "a" ) ); + client().ensureIndex( ns, BSON( "i" << 1 ) ); + ASSERT_EQUALS( 1, client().count( ns, fromjson( "{i:{$in:['a']}}" ) ) ); + } + }; class All : public UnitTest::Suite { public: @@ -643,6 +656,7 @@ namespace QueryTests { add< SubobjArr >(); add< MinMax >(); add< DirectLocking >(); + add< FastCountIn >(); } }; |