public override bool Contains(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
ThrowIfDisposed();
using (var bsonReader = new BsonBinaryReader(new BsonBuffer(CloneSlice(), true), true, _readerSettings))
{
bsonReader.ReadStartDocument();
while (bsonReader.ReadBsonType() != BsonType.EndOfDocument)
{
if (bsonReader.ReadName() == name)
{
return true;
}
bsonReader.SkipValue();
}
bsonReader.ReadEndDocument();
return false;
}
}