mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
simple null test
This commit is contained in:
parent
23936952c1
commit
1d1081a32f
14
jstests/null.js
Normal file
14
jstests/null.js
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
t = db.null1;
|
||||
t.drop();
|
||||
|
||||
t.save( { x : 1 } );
|
||||
t.save( { x : null } );
|
||||
|
||||
assert.eq( 1 , t.find( { x : null } ).count() , "A" );
|
||||
assert.eq( 1 , t.find( { x : { $ne : null } } ).count() , "B" );
|
||||
|
||||
t.ensureIndex( { x : 1 } );
|
||||
|
||||
assert.eq( 1 , t.find( { x : null } ).count() , "C" );
|
||||
assert.eq( 1 , t.find( { x : { $ne : null } } ).count() , "D" );
|
Loading…
Reference in New Issue
Block a user