CSMongo.Query.MongoQuery.Unset C# (CSharp) Method

Unset() public method

Removes all matching fields from each document in the query
public Unset ( ) : void
return void
        public void Unset(params string[] fields)
        {
            //mark the fields to be removed
            BsonDocument remove = new BsonDocument();
            foreach (string field in fields) {
                remove.Set<int>(field, 1);
            }

            //send the command
            this._SendUpdate("$unset", UpdateOptionTypes.MultiUpdate, remove);
        }