protected IAsyncCursor <BsonDocument> GetFilestoreCursor(IMongoCollection <BsonDocument> collection) { var queryRequestsByFile = MongoQueryFilestoreHelper.FilestoreByFile(collection); var ignoreUnusedFieldsProjection = MongoQueryFilestoreHelper.IgnoreUnusedFilestoreFieldsProjection(); return(collection.Find(queryRequestsByFile).Project(ignoreUnusedFieldsProjection).ToCursor()); }
/// <summary> /// Count the number of Filestore events in the collection. /// </summary> /// <param name="collection">The collection to search for requests in.</param> /// <returns>The number of Filestore Events in the collection</returns> protected long CountFilestoreEvents(IMongoCollection <BsonDocument> collection) { var query = MongoQueryFilestoreHelper.FilestoreByFile(collection); return(collection.Count(query)); }