-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:linux / java 6
which are perfect valid if using the shell:
> db.po.insert(
);
> db.po.insert(
);
> db.po.find(
);
{ "_id" : ObjectId("4e3940ff933089c859e4d4f9"), "" : 1 }error source:
private void _checkKeys( DBObject o ) {
for ( String s : o.keySet() ){
if ( s.contains( "." ) )
throw new IllegalArgumentException( "fields stored in
the db can't have . in them" );
if ( s.charAt( 0 ) == '$' )
throw new IllegalArgumentException( "fields stored in
the db can't start with '$'" );
Object inner;
if ( (inner = o.get( s )) instanceof DBObject )
}
}
if ( s.charAt( 0 ) == '$' )
should be:
if (s.startWith('$' ))