示例#1
0
        protected IAsyncCursor <BsonDocument> GetFilestoreCursor(IMongoCollection <BsonDocument> collection)
        {
            var queryRequestsByFile          = MongoQueryFilestoreHelper.FilestoreByFile(collection);
            var ignoreUnusedFieldsProjection = MongoQueryFilestoreHelper.IgnoreUnusedFilestoreFieldsProjection();

            return(collection.Find(queryRequestsByFile).Project(ignoreUnusedFieldsProjection).ToCursor());
        }
示例#2
0
        /// <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));
        }