diff options
author | Aaron <aaron@10gen.com> | 2009-04-13 16:40:30 -0400 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-04-13 16:40:30 -0400 |
commit | ce293a0452f1cc914c0a888c255867aabaa42fcc (patch) | |
tree | 862fddc73f989b54d866f7df5f33f4a7db2af960 /dbtests | |
parent | 5cfc62999c106433a3e20293d7d5cc8877ecfb3b (diff) | |
download | mongo-ce293a0452f1cc914c0a888c255867aabaa42fcc.tar.gz |
ne applies to all multikey values, adjust 'size' and 'all' behavior for objects within arrays
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/querytests.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/dbtests/querytests.cpp b/dbtests/querytests.cpp index be3925014df..6702e5595cb 100644 --- a/dbtests/querytests.cpp +++ b/dbtests/querytests.cpp @@ -372,11 +372,24 @@ namespace QueryTests { void run() { const char *ns = "querytests.Ne"; client().insert( ns, fromjson( "{a:[1,2]}" ) ); + ASSERT( client().findOne( ns, fromjson( "{a:{$ne:1}}" ) ).isEmpty() ); BSONObj spec = fromjson( "{a:{$ne:1,$ne:2}}" ); - ASSERT( !client().findOne( ns, spec ).isEmpty() ); + ASSERT( client().findOne( ns, spec ).isEmpty() ); } }; + class EmbeddedNe : public ClientBase { + public: + ~EmbeddedNe() { + client().dropCollection( "querytests.NestedNe" ); + } + void run() { + const char *ns = "querytests.NestedNe"; + client().insert( ns, fromjson( "{a:[{b:1},{b:2}]}" ) ); + ASSERT( client().findOne( ns, fromjson( "{'a.b':{$ne:1}}" ) ).isEmpty() ); + } + }; + class All : public UnitTest::Suite { public: All() { @@ -397,6 +410,7 @@ namespace QueryTests { add< UnderscoreNs >(); add< EmptyFieldSpec >(); add< MultiNe >(); + add< EmbeddedNe >(); } }; |