MongoDB.Driver.Collection.UpdateAll C# (CSharp) Метод

UpdateAll() публичный Метод

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 UpdateAll ( Document doc, Document selector ) : void
doc Document
selector Document
Результат void
        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){
                //wrap document in a $set.
                Document s = new Document().Append("$set", doc);
                doc = s;
            }
            this.Update(doc, selector, UpdateFlags.MultiUpdate);
        }

Same methods

Collection::UpdateAll ( Document doc, Document selector, bool safemode ) : void