Bend.BsonHelper._applyUnset C# (CSharp) Метод

_applyUnset() приватный статический Метод

private static _applyUnset ( BsonDocument topdoc, BsonDocument changes ) : void
topdoc BsonDocument
changes BsonDocument
Результат void
        private static void _applyUnset(BsonDocument topdoc, BsonDocument changes)
        {
            // TODO: this is going to create the entire document path going down
            //   to the unset, but that's NOT what what we should do.

            foreach (var field in changes) {
                string field_name;
                BsonDocument doc;
                _traverseToField(topdoc, field.Name, out field_name, out doc);

                if (doc.Contains(field_name)) {
                    doc.Remove(field_name);
                }
            }
        }