Exemple #1
0
        protected IAsyncCursor <BsonDocument> GetSearchserverCursor(IMongoCollection <BsonDocument> collection)
        {
            var queryRequestsByFile          = MongoQuerySearchserverHelper.SearchserverByFile(collection);
            var ignoreUnusedFieldsProjection = MongoQuerySearchserverHelper.IgnoreUnusedSearchserverFieldsProjection();

            return(collection.Find(queryRequestsByFile).Project(ignoreUnusedFieldsProjection).ToCursor());
        }
Exemple #2
0
        /// <summary>
        /// Count the number of Search server events in the collection.
        /// </summary>
        /// <param name="collection">The collection to search for requests in.</param>
        /// <returns>The number of Searchserver Events in the collection</returns>
        protected long CountSearchserverEvents(IMongoCollection <BsonDocument> collection)
        {
            var query = MongoQuerySearchserverHelper.SearchserverByFile(collection);

            return(collection.Count(query));
        }