Accept BsonDocument as sample rather than string.