예제 #1
0
        protected override Task SetupCollectionAsync(IMongoCollection <MongoContentEntity> collection,
                                                     CancellationToken ct)
        {
            var operations = new OperationBase[]
            {
                queryAsStream,
                queryBdId,
                queryByIds,
                queryByQuery,
                queryReferences,
                queryReferrers,
                queryScheduled
            };

            foreach (var operation in operations)
            {
                operation.Setup(collection);
            }

            return(collection.Indexes.CreateManyAsync(operations.SelectMany(x => x.CreateIndexes()), ct));
        }