mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
cleaning
This commit is contained in:
parent
3e5d63dd63
commit
63c52d08da
@ -389,13 +389,15 @@ namespace mongo {
|
||||
BSONObjIterator i( query );
|
||||
while ( i.more() ){
|
||||
BSONElement e = i.next();
|
||||
uassert( "upsert with foo.bar type queries not supported yet" , strchr( e.fieldName() , '.' ) == 0 );
|
||||
|
||||
if ( e.type() == Object && e.embeddedObject().firstElement().fieldName()[0] == '$' ){
|
||||
// this means this is a $gt type filter, so don't make part of the new object
|
||||
continue;
|
||||
}
|
||||
|
||||
uassert( "upsert with foo.bar type queries not supported yet" , strchr( e.fieldName() , '.' ) == 0 );
|
||||
|
||||
|
||||
bb.append( e );
|
||||
}
|
||||
newObj = bb.obj();
|
||||
|
@ -3,6 +3,9 @@ t = db.update8;
|
||||
t.drop();
|
||||
|
||||
t.update( { _id : 1 , tags: {"$ne": "a"}}, {"$push": { tags : "a" } } , true )
|
||||
le = db.getLastError()
|
||||
assert.isnull( le , le );
|
||||
assert.eq( { _id : 1 , tags : [ "a" ] } , t.findOne() , "A" );
|
||||
|
||||
t.drop()
|
||||
//SERVER-390
|
||||
//t.update( { "x.y" : 1 } , { $inc : { i : 1 } } , true );
|
||||
//printjson( t.findOne() );
|
||||
|
Loading…
Reference in New Issue
Block a user