mongo-debian/jstests/basic9.js
2010-09-02 17:38:06 +02:00

25 lines
414 B
JavaScript

t = db.getCollection( "foo_basic9" );
t.save( { "foo$bar" : 5 } );
ok = false;
try{
t.save( { "$foo" : 5 } );
ok = false;
}
catch ( e ){
ok = true;
}
assert( ok , "key names aren't allowed to start with $ doesn't work" );
try{
t.save( { "x" : { "$foo" : 5 } } );
ok = false;
}
catch ( e ){
ok = true;
}
assert( ok , "embedded key names aren't allowed to start with $ doesn't work" );