Ah, I see.
Our EF indexes expect the CreateIndexOptions to be of type BsonDocument, for example:
var options = new CreateIndexOptions<BsonDocument> {
Unique = true,
PartialFilterExpression = Builders<BsonDocument>.Filter.Type(n => n["Version1Id", BsonType.String)
};
This is a known limitation caused by the underlying MongoDB C# Driver not being able to give us MQL for a given LINQ statement yet. We’re hoping to address that in a future release as we’ll also need it for the EF9 bulk update operations.
The BsonDocument equivalent above should work for both although obviously it is more error prone given the lack of lambdas and manually specified element names.