0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/basic9.js
2010-08-23 12:54:02 -04:00

26 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" );