Пример #1
0
        public long SelectCount <T>(string collectionName, string field, T value)
        {
            var collection = _database.GetCollection <BsonDocument>(collectionName);

            return(collection.Find(Builders.FilterEq <T>(field, value)).CountDocuments());
        }
Пример #2
0
        public long SelectCount(string collectionName, string field, ObjectId id)
        {
            var collection = _database.GetCollection <BsonDocument>(collectionName);

            return(collection.Find(Builders.FilterEq(field, id)).CountDocuments());
        }