From a2d003423d45952fa162d214cfbc166f732a3ff2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 29 Jul 2019 22:36:51 +0200 Subject: [PATCH] Remove support for other mongodb engines. --- .../Assets/MongoAssetRepository.cs | 58 +++++++------------ .../Contents/MongoContentCollection.cs | 4 +- .../Contents/MongoContentRepository.cs | 4 +- .../History/MongoHistoryEventRepository.cs | 32 +++++----- .../Rules/MongoRuleEventRepository.cs | 25 ++++---- .../MongoPersistedGrantStore.cs | 15 +++-- .../MongoRoleStore.cs | 10 +--- .../MongoUserStore.cs | 53 ++++++++--------- .../EventSourcing/MongoEventStore.cs | 25 +++++--- .../Migrations/MongoMigrationStatus.cs | 4 +- .../MongoDb/MongoDbEngine.cs | 15 ----- .../MongoDb/MongoDbOptions.cs | 24 -------- .../MongoDb/MongoRepositoryBase.cs | 16 +---- .../States/MongoSnapshotStore.cs | 4 +- .../UsageTracking/MongoUsageRepository.cs | 4 +- .../Config/Domain/EventStoreServices.cs | 2 +- src/Squidex/Config/Domain/StoreServices.cs | 3 - src/Squidex/appsettings.json | 6 +- .../EventSourcing/MongoEventStoreFixture.cs | 2 +- 19 files changed, 118 insertions(+), 188 deletions(-) delete mode 100644 src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbEngine.cs delete mode 100644 src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbOptions.cs diff --git a/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs b/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs index 8fcec63f8..3e77f5bbc 100644 --- a/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs +++ b/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs @@ -24,8 +24,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Assets { public sealed partial class MongoAssetRepository : MongoRepositoryBase, IAssetRepository { - public MongoAssetRepository(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoAssetRepository(IMongoDatabase database) + : base(database) { } @@ -36,40 +36,26 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Assets protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - return collection.Indexes.CreateManyAsync( - new[] - { - new CreateIndexModel( - Index - .Ascending(x => x.AppId) - .Ascending(x => x.IsDeleted) - .Ascending(x => x.FileName) - .Ascending(x => x.Tags) - .Descending(x => x.LastModified), - new CreateIndexOptions - { - Name = Options.IsDocumentDb ? "FileName_Tags" : null - }), - new CreateIndexModel( - Index - .Ascending(x => x.AppId) - .Ascending(x => x.IsDeleted) - .Ascending(x => x.FileHash), - new CreateIndexOptions - { - Name = Options.IsDocumentDb ? "FileHash" : null - }), - new CreateIndexModel( - Index - .Ascending(x => x.AppId) - .Ascending(x => x.IsDeleted) - .Ascending(x => x.Slug), - new CreateIndexOptions - { - Name = Options.IsDocumentDb ? "Slug" : null - }) - }, - ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel( + Index + .Ascending(x => x.AppId) + .Ascending(x => x.IsDeleted) + .Ascending(x => x.FileName) + .Ascending(x => x.Tags) + .Descending(x => x.LastModified)), + new CreateIndexModel( + Index + .Ascending(x => x.AppId) + .Ascending(x => x.IsDeleted) + .Ascending(x => x.FileHash)), + new CreateIndexModel( + Index + .Ascending(x => x.AppId) + .Ascending(x => x.IsDeleted) + .Ascending(x => x.Slug)) + }, ct); } public async Task> QueryAsync(Guid appId, ClrQuery query) diff --git a/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentCollection.cs b/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentCollection.cs index 8201f4d02..53ce48b44 100644 --- a/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentCollection.cs +++ b/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentCollection.cs @@ -34,8 +34,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents private readonly IAppProvider appProvider; private readonly IJsonSerializer serializer; - public MongoContentCollection(IMongoDatabase database, IOptions options, IJsonSerializer serializer, IAppProvider appProvider) - : base(database, options) + public MongoContentCollection(IMongoDatabase database, IJsonSerializer serializer, IAppProvider appProvider) + : base(database) { this.appProvider = appProvider; diff --git a/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs b/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs index 0cde952dd..d5ca2727d 100644 --- a/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs +++ b/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs @@ -43,7 +43,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents StatusSerializer.Register(); } - public MongoContentRepository(IMongoDatabase database, IOptions options, IAppProvider appProvider, IJsonSerializer serializer, ITextIndexer indexer, TypeNameRegistry typeNameRegistry) + public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, IJsonSerializer serializer, ITextIndexer indexer, TypeNameRegistry typeNameRegistry) { Guard.NotNull(appProvider, nameof(appProvider)); Guard.NotNull(database, nameof(database)); @@ -59,7 +59,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents typeAssetDeleted = typeNameRegistry.GetName(); typeContentDeleted = typeNameRegistry.GetName(); - contents = new MongoContentCollection(database, options, serializer, appProvider); + contents = new MongoContentCollection(database, serializer, appProvider); } public Task InitializeAsync(CancellationToken ct = default) diff --git a/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs b/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs index d959438e6..f90270ff9 100644 --- a/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs +++ b/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs @@ -19,8 +19,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.History { public class MongoHistoryEventRepository : MongoRepositoryBase, IHistoryEventRepository { - public MongoHistoryEventRepository(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoHistoryEventRepository(IMongoDatabase database) + : base(database) { } @@ -31,18 +31,22 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.History protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - return collection.Indexes.CreateManyAsync( - new[] - { - new CreateIndexModel( - Index - .Ascending(x => x.AppId) - .Ascending(x => x.Channel) - .Descending(x => x.Created) - .Descending(x => x.Version)), - new CreateIndexModel(Index.Ascending(x => x.Created), - new CreateIndexOptions { ExpireAfter = TimeSpan.FromDays(365) }) - }, ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel( + Index + .Ascending(x => x.AppId) + .Ascending(x => x.Channel) + .Descending(x => x.Created) + .Descending(x => x.Version)), + new CreateIndexModel( + Index + .Ascending(x => x.Created), + new CreateIndexOptions + { + ExpireAfter = TimeSpan.FromDays(365) + }) + }, ct); } public async Task> QueryByChannelAsync(Guid appId, string channelPrefix, int count) diff --git a/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs b/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs index e97ea07da..fea229b14 100644 --- a/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs +++ b/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventRepository.cs @@ -23,8 +23,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules { public sealed class MongoRuleEventRepository : MongoRepositoryBase, IRuleEventRepository { - public MongoRuleEventRepository(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoRuleEventRepository(IMongoDatabase database) + : base(database) { } @@ -33,15 +33,20 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules return "RuleEvents"; } - protected override async Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) + protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - await collection.Indexes.CreateManyAsync( - new[] - { - new CreateIndexModel(Index.Ascending(x => x.NextAttempt)), - new CreateIndexModel(Index.Ascending(x => x.AppId).Descending(x => x.Created)), - new CreateIndexModel(Index.Ascending(x => x.Expires), new CreateIndexOptions { ExpireAfter = TimeSpan.Zero }) - }, ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel(Index.Ascending(x => x.NextAttempt)), + new CreateIndexModel(Index.Ascending(x => x.AppId).Descending(x => x.Created)), + new CreateIndexModel( + Index + .Ascending(x => x.Expires), + new CreateIndexOptions + { + ExpireAfter = TimeSpan.Zero + }) + }, ct); } public Task QueryPendingAsync(Instant now, Func callback, CancellationToken ct = default) diff --git a/src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs b/src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs index 30f970f12..929c2d129 100644 --- a/src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs +++ b/src/Squidex.Domain.Users.MongoDb/Infrastructure/MongoPersistedGrantStore.cs @@ -31,8 +31,8 @@ namespace Squidex.Domain.Users.MongoDb.Infrastructure }); } - public MongoPersistedGrantStore(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoPersistedGrantStore(IMongoDatabase database) + : base(database) { } @@ -43,12 +43,11 @@ namespace Squidex.Domain.Users.MongoDb.Infrastructure protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - return collection.Indexes.CreateManyAsync( - new[] - { - new CreateIndexModel(Index.Ascending(x => x.ClientId)), - new CreateIndexModel(Index.Ascending(x => x.SubjectId)) - }, ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel(Index.Ascending(x => x.ClientId)), + new CreateIndexModel(Index.Ascending(x => x.SubjectId)) + }, ct); } public Task StoreAsync(PersistedGrant grant) diff --git a/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs b/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs index 779bc717e..2d0a425bf 100644 --- a/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs +++ b/src/Squidex.Domain.Users.MongoDb/MongoRoleStore.cs @@ -31,8 +31,8 @@ namespace Squidex.Domain.Users.MongoDb }); } - public MongoRoleStore(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoRoleStore(IMongoDatabase database) + : base(database) { } @@ -41,17 +41,11 @@ namespace Squidex.Domain.Users.MongoDb return "Identity_Roles"; } - protected override string ShardKey() - { - return "Shard"; - } - protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { return collection.Indexes.CreateOneAsync( new CreateIndexModel( Index - .Ascending("Shard") .Ascending(x => x.NormalizedName), new CreateIndexOptions { diff --git a/src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs b/src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs index 6c1e50526..6fd9126ad 100644 --- a/src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs +++ b/src/Squidex.Domain.Users.MongoDb/MongoUserStore.cs @@ -105,8 +105,8 @@ namespace Squidex.Domain.Users.MongoDb }); } - public MongoUserStore(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoUserStore(IMongoDatabase database) + : base(database) { } @@ -115,36 +115,29 @@ namespace Squidex.Domain.Users.MongoDb return "Identity_Users"; } - protected override string ShardKey() - { - return "Shard"; - } - protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - return collection.Indexes.CreateManyAsync( - new[] - { - Options.IsDocumentDb ? - new CreateIndexModel(Index.Ascending("Logins.LoginProvider")) : - new CreateIndexModel(Index.Ascending("Logins.LoginProvider").Ascending("Logins.ProviderKey")), - new CreateIndexModel( - Index - .Ascending("Shard") - .Ascending(x => x.NormalizedUserName), - new CreateIndexOptions - { - Unique = true - }), - new CreateIndexModel( - Index - .Ascending("Shard") - .Ascending(x => x.NormalizedEmail), - new CreateIndexOptions - { - Unique = true - }) - }, ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel( + Index + .Ascending("Logins.LoginProvider") + .Ascending("Logins.ProviderKey")), + new CreateIndexModel( + Index + .Ascending(x => x.NormalizedUserName), + new CreateIndexOptions + { + Unique = true + }), + new CreateIndexModel( + Index + .Ascending(x => x.NormalizedEmail), + new CreateIndexOptions + { + Unique = true + }) + }, ct); } protected override MongoCollectionSettings CollectionSettings() diff --git a/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs b/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs index e74cfaf0e..df8a250ff 100644 --- a/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs +++ b/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs @@ -27,8 +27,8 @@ namespace Squidex.Infrastructure.EventSourcing get { return Database.GetCollection(CollectionName()); } } - public MongoEventStore(IMongoDatabase database, IOptions options, IEventNotifier notifier) - : base(database, options) + public MongoEventStore(IMongoDatabase database, IEventNotifier notifier) + : base(database) { Guard.NotNull(notifier, nameof(notifier)); @@ -47,12 +47,21 @@ namespace Squidex.Infrastructure.EventSourcing protected override Task SetupCollectionAsync(IMongoCollection collection, CancellationToken ct = default) { - return collection.Indexes.CreateManyAsync( - new[] - { - new CreateIndexModel(Index.Ascending(x => x.Timestamp).Ascending(x => x.EventStream)), - new CreateIndexModel(Index.Ascending(x => x.EventStream).Descending(x => x.EventStreamOffset), new CreateIndexOptions { Unique = true }) - }, ct); + return collection.Indexes.CreateManyAsync(new[] + { + new CreateIndexModel( + Index + .Ascending(x => x.Timestamp) + .Ascending(x => x.EventStream)), + new CreateIndexModel( + Index + .Ascending(x => x.EventStream) + .Descending(x => x.EventStreamOffset), + new CreateIndexOptions + { + Unique = true + }) + }, ct); } } } \ No newline at end of file diff --git a/src/Squidex.Infrastructure.MongoDb/Migrations/MongoMigrationStatus.cs b/src/Squidex.Infrastructure.MongoDb/Migrations/MongoMigrationStatus.cs index f8a520828..e54461bd5 100644 --- a/src/Squidex.Infrastructure.MongoDb/Migrations/MongoMigrationStatus.cs +++ b/src/Squidex.Infrastructure.MongoDb/Migrations/MongoMigrationStatus.cs @@ -17,8 +17,8 @@ namespace Squidex.Infrastructure.Migrations private const string DefaultId = "Default"; private static readonly FindOneAndUpdateOptions UpsertFind = new FindOneAndUpdateOptions { IsUpsert = true }; - public MongoMigrationStatus(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoMigrationStatus(IMongoDatabase database) + : base(database) { } diff --git a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbEngine.cs b/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbEngine.cs deleted file mode 100644 index 8dff4092f..000000000 --- a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbEngine.cs +++ /dev/null @@ -1,15 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -namespace Squidex.Infrastructure.MongoDb -{ - public enum MongoDbEngine - { - DocumentDb, - MongoDb, - } -} diff --git a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbOptions.cs b/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbOptions.cs deleted file mode 100644 index 6df6b5655..000000000 --- a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoDbOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// ========================================================================== -// Squidex Headless CMS -// ========================================================================== -// Copyright (c) Squidex UG (haftungsbeschraenkt) -// All rights reserved. Licensed under the MIT license. -// ========================================================================== - -namespace Squidex.Infrastructure.MongoDb -{ - public sealed class MongoDbOptions - { - public MongoDbEngine Engine { get; set; } = MongoDbEngine.MongoDb; - - public bool IsDocumentDb - { - get { return Engine == MongoDbEngine.DocumentDb; } - } - - public bool IsMongoDb - { - get { return Engine == MongoDbEngine.MongoDb; } - } - } -} diff --git a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoRepositoryBase.cs b/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoRepositoryBase.cs index 923d57660..22d7d28cb 100644 --- a/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoRepositoryBase.cs +++ b/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoRepositoryBase.cs @@ -31,7 +31,6 @@ namespace Squidex.Infrastructure.MongoDb protected static readonly ProjectionDefinitionBuilder Projection = Builders.Projection; private readonly IMongoDatabase mongoDatabase; - private readonly MongoDbOptions options; private Lazy> mongoCollection; protected IMongoCollection Collection @@ -44,11 +43,6 @@ namespace Squidex.Infrastructure.MongoDb get { return mongoDatabase; } } - protected MongoDbOptions Options - { - get { return options; } - } - static MongoRepositoryBase() { RefTokenSerializer.Register(); @@ -56,15 +50,12 @@ namespace Squidex.Infrastructure.MongoDb InstantSerializer.Register(); } - protected MongoRepositoryBase(IMongoDatabase database, IOptions options) + protected MongoRepositoryBase(IMongoDatabase database) { Guard.NotNull(database, nameof(database)); - Guard.NotNull(options, nameof(options)); mongoDatabase = database; mongoCollection = CreateCollection(); - - this.options = options.Value; } protected virtual MongoCollectionSettings CollectionSettings() @@ -72,11 +63,6 @@ namespace Squidex.Infrastructure.MongoDb return new MongoCollectionSettings(); } - protected virtual string ShardKey() - { - return "_id"; - } - protected virtual string CollectionName() { return string.Format(CultureInfo.InvariantCulture, CollectionFormat, typeof(TEntity).Name); diff --git a/src/Squidex.Infrastructure.MongoDb/States/MongoSnapshotStore.cs b/src/Squidex.Infrastructure.MongoDb/States/MongoSnapshotStore.cs index f855fda36..37b4a1227 100644 --- a/src/Squidex.Infrastructure.MongoDb/States/MongoSnapshotStore.cs +++ b/src/Squidex.Infrastructure.MongoDb/States/MongoSnapshotStore.cs @@ -20,8 +20,8 @@ namespace Squidex.Infrastructure.States { public class MongoSnapshotStore : MongoRepositoryBase>, ISnapshotStore { - public MongoSnapshotStore(IMongoDatabase database, IOptions options, JsonSerializer jsonSerializer) - : base(database, options) + public MongoSnapshotStore(IMongoDatabase database, JsonSerializer jsonSerializer) + : base(database) { Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); diff --git a/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs b/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs index f5e682ba5..5263990ca 100644 --- a/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs +++ b/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs @@ -20,8 +20,8 @@ namespace Squidex.Infrastructure.UsageTracking { private static readonly BulkWriteOptions Unordered = new BulkWriteOptions { IsOrdered = false }; - public MongoUsageRepository(IMongoDatabase database, IOptions options) - : base(database, options) + public MongoUsageRepository(IMongoDatabase database) + : base(database) { } diff --git a/src/Squidex/Config/Domain/EventStoreServices.cs b/src/Squidex/Config/Domain/EventStoreServices.cs index b16b6b82f..0bd547fa3 100644 --- a/src/Squidex/Config/Domain/EventStoreServices.cs +++ b/src/Squidex/Config/Domain/EventStoreServices.cs @@ -40,7 +40,7 @@ namespace Squidex.Config.Domain var mongoClient = Singletons.GetOrAdd(mongoConfiguration, s => new MongoClient(s)); var mongDatabase = mongoClient.GetDatabase(mongoDatabaseName); - return new MongoEventStore(mongDatabase, c.GetRequiredService>(), c.GetRequiredService()); + return new MongoEventStore(mongDatabase, c.GetRequiredService()); }) .As(); }, diff --git a/src/Squidex/Config/Domain/StoreServices.cs b/src/Squidex/Config/Domain/StoreServices.cs index 213ba9f48..836852ebc 100644 --- a/src/Squidex/Config/Domain/StoreServices.cs +++ b/src/Squidex/Config/Domain/StoreServices.cs @@ -52,8 +52,6 @@ namespace Squidex.Config.Domain var mongoDatabaseName = config.GetRequiredValue("store:mongoDb:database"); var mongoContentDatabaseName = config.GetOptionalValue("store:mongoDb:contentDatabase", mongoDatabaseName); - services.Configure(config.GetSection("store:mongoDB")); - services.AddSingleton(typeof(ISnapshotStore<,>), typeof(MongoSnapshotStore<,>)); services.AddSingletonAs(_ => Singletons.GetOrAdd(mongoConfiguration, s => new MongoClient(s))) @@ -105,7 +103,6 @@ namespace Squidex.Config.Domain services.AddSingletonAs(c => new MongoContentRepository( c.GetRequiredService().GetDatabase(mongoContentDatabaseName), - c.GetRequiredService>(), c.GetRequiredService(), c.GetRequiredService(), c.GetRequiredService(), diff --git a/src/Squidex/appsettings.json b/src/Squidex/appsettings.json index 4c6258cbb..86ff93356 100644 --- a/src/Squidex/appsettings.json +++ b/src/Squidex/appsettings.json @@ -395,11 +395,7 @@ /* * The database for all your other read collections. */ - "database": "Squidex", - /* - * The MongoDb Engine. Supported: MongoDb, DocumentDb - */ - "engine": "MongoDb" + "database": "Squidex" } }, diff --git a/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs b/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs index 9080ed7cf..c09fba8d8 100644 --- a/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs +++ b/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreFixture.cs @@ -29,7 +29,7 @@ namespace Squidex.Infrastructure.EventSourcing BsonJsonConvention.Register(JsonSerializer.Create(JsonHelper.DefaultSettings())); - EventStore = new MongoEventStore(mongoDatabase, Options.Create(new MongoDbOptions()), notifier); + EventStore = new MongoEventStore(mongoDatabase, notifier); EventStore.InitializeAsync().Wait(); }