MongoDBDriver/Collection.cs
/// <summary>
/// Runs a multiple update query against the database.  It will wrap any 
/// doc with $set if the passed in doc doesn't contain any '$' ops.
/// </summary>
/// <param name="doc"></param>
/// <param name="selector"></param>
Runs a multiple update query against the database.  It will wrap any
doc with $set if the passed in doc doesn't contain any '$' ops.
Runs a multiple update query against the database . It will wrap any doc with $set if the passed in doc doesn ' t contain any ' $ ' ops .
public void UpdateAll(Document doc, Document selector){
            bool foundOp = false;
            foreach(string key in doc.Keys){
                if(key.IndexOf('$') == 0){
                    foundOp = true;
                    break;
                }
            }
            if(foundOp == false){
                Document s = new Document().Append("$set", doc);
                doc = s;
            }
            this.Update(doc, selector, UpdateFlags.MultiUpdate);           
        }
public void UpdateAll ( Document doc , Document selector ) { bool foundOp = false ; foreach ( string key in doc . Keys ) { if ( key . IndexOf ( ' ' ) == 0 ) { foundOp = true ; break ; } } if ( foundOp == false ) { Document s = new Document ( ) . Append ( " " , doc ) ; doc = s ; } this . Update ( doc , selector , UpdateFlags . MultiUpdate ) ; }
Runs a multiple update query against the database.
Runs a multiple update query against the database .
//wrap document in a $set.
doc
Document
None
selector
Document
None