Update the documentation pages

This commit is contained in:
OpenIddict Bot
2021-06-29 17:30:39 +00:00
parent f669cd5b26
commit b6c3c864e9
2 changed files with 21 additions and 16 deletions

View File

@@ -96,11 +96,13 @@ var services = new ServiceCollection();
services.AddOpenIddict() services.AddOpenIddict()
.AddCore(options => options.UseMongoDb()); .AddCore(options => options.UseMongoDb());
services.AddSingleton(new MongoClient("mongodb://localhost:27017").GetDatabase("openiddict")); services.AddSingleton(new MongoClient(
"mongodb://localhost:27017").GetDatabase("openiddict"));
var provider = services.BuildServiceProvider(); var provider = services.BuildServiceProvider();
var context = provider.GetRequiredService<IOpenIddictMongoDbContext>(); var context = provider.GetRequiredService<IOpenIddictMongoDbContext>();
var options = provider.GetRequiredService<IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue; var options = provider.GetRequiredService<
IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue;
var database = await context.GetDatabaseAsync(CancellationToken.None); var database = await context.GetDatabaseAsync(CancellationToken.None);
var applications = database.GetCollection<OpenIddictMongoDbApplication>( var applications = database.GetCollection<OpenIddictMongoDbApplication>(
@@ -136,7 +138,8 @@ await applications.Indexes.CreateManyAsync(new[]
var authorizations = database.GetCollection<OpenIddictMongoDbAuthorization>( var authorizations = database.GetCollection<OpenIddictMongoDbAuthorization>(
options.AuthorizationsCollectionName); options.AuthorizationsCollectionName);
await authorizations.Indexes.CreateOneAsync(new CreateIndexModel<OpenIddictMongoDbAuthorization>( await authorizations.Indexes.CreateOneAsync(
new CreateIndexModel<OpenIddictMongoDbAuthorization>(
Builders<OpenIddictMongoDbAuthorization>.IndexKeys Builders<OpenIddictMongoDbAuthorization>.IndexKeys
.Ascending(authorization => authorization.ApplicationId) .Ascending(authorization => authorization.ApplicationId)
.Ascending(authorization => authorization.Scopes) .Ascending(authorization => authorization.Scopes)
@@ -164,13 +167,15 @@ var tokens = database.GetCollection<OpenIddictMongoDbToken>(
await tokens.Indexes.CreateManyAsync(new[] await tokens.Indexes.CreateManyAsync(new[]
{ {
new CreateIndexModel<OpenIddictMongoDbToken>( new CreateIndexModel<OpenIddictMongoDbToken>(
Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending(token => token.ReferenceId), Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending(
token => token.ReferenceId),
new CreateIndexOptions<OpenIddictMongoDbToken> new CreateIndexOptions<OpenIddictMongoDbToken>
{ {
// Note: partial filter expressions are not supported on Azure Cosmos DB. // Note: partial filter expressions are not supported on Azure Cosmos DB.
// As a workaround, the expression and the unique constraint can be removed. // As a workaround, the expression and the unique constraint can be removed.
PartialFilterExpression = PartialFilterExpression =
Builders<OpenIddictMongoDbToken>.Filter.Exists(token => token.ReferenceId), Builders<OpenIddictMongoDbToken>.Filter.Exists(
token => token.ReferenceId),
Unique = true Unique = true
}), }),

View File

@@ -5661,7 +5661,7 @@
"output": { "output": {
".html": { ".html": {
"relative_path": "configuration/mongodb-integration.html", "relative_path": "configuration/mongodb-integration.html",
"hash": "OBbgaaZ+b0E3MY4vEl7/kw==" "hash": "za1L8HGicVtf0iDEj8PMvw=="
} }
}, },
"is_incremental": false, "is_incremental": false,