Permalink
Browse files

cleaning

  • Loading branch information...
1 parent 3e5d63d commit 63c52d08da93d175b4fb9672cdf1ec13a3ed5807 @erh erh committed Dec 17, 2009
Showing with 8 additions and 3 deletions.
  1. +3 −1 db/update.cpp
  2. +5 −2 jstests/update8.js
View
4 db/update.cpp
@@ -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
7 jstests/update8.js
@@ -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() );

0 comments on commit 63c52d0

Please sign in to comment.