0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
This commit is contained in:
Eliot Horowitz 2009-12-16 23:34:43 -05:00
parent 3e5d63dd63
commit 63c52d08da
2 changed files with 8 additions and 3 deletions

View File

@ -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();

View File

@ -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() );