alexandre-spieser/AspNetCore.Identity.MongoDbCore

Creating indices programmatically

Closed this issue · 4 comments

How can create indices programmatically?

Hi,

currently the MongoDbGenericRepository does not support this, but I am working on it ;)

In a few weeks when I have tested everything, I will release a new version of the MongoDbGenericRepository nuget package that will have this feature.

In the mean time you can always roll your own, by extending the repo and using the HandlePartitioned<TDocument,TKey>(partitionKey) handler to get the collections in a generic fashion.

PS: The AspNetCore.Identity.MongoDbCore package will never expose the index creation functionality in its interface. It is not its responsibility, however its dependency MongoDbGenericRepository will however allow you to do that.

This is now covered by the following release in MongoDbGenericRepository:

https://github.com/alexandre-spieser/mongodb-generic-repository/releases/tag/1.3.8

The reference of the MongoDbGenericRepository version has been updated in the latest release of this package.

Install-Package AspNetCore.Identity.MongoDbCore -Version 1.0.9

Hi,

currently the MongoDbGenericRepository does not support this, but I am working on it ;)

In a few weeks when I have tested everything, I will release a new version of the MongoDbGenericRepository nuget package that will have this feature.

In the mean time you can always roll your own, by extending the repo and using the HandlePartitioned<TDocument,TKey>(partitionKey) handler to get the collections in a generic fashion.

PS: The AspNetCore.Identity.MongoDbCore package will never expose the index creation functionality in its interface. It is not its responsibility, however its dependency MongoDbGenericRepository will however allow you to do that.

Please. Show me how i can extend repo and create index