In my database I use collections where Models can not be applied. This due to the different object types stored in one collection (all of type BsonDocument)
On this collection I create Index structures with CreateOneAsync based on a BsonDocument.
Now the compiler warns me that this is obsolete:
‘IMongoIndexManager.CreateOneAsync(IndexKeysDefinition, CreateIndexOptions, CancellationToken)’ is obsolete: ‘Use CreateOneAsync with a CreateIndexModel instead.’
I would like to request that this operation should not be marked as obsolete. Due to the nature of MongoDB serving BsonDocuments in the first place. I think this flexible structural nature of MongoDB should be respected by MongoDB.Driver as well. Even in dot-net you can and will use BsonDocuments instead of fixed Models if the solution makes this necessary.