Allow CreateIndex partial filters strong typing

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • None
    • None
    • Dotnet Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      When using CreateIndex users are forced to use CreateIndex<BsonDocument> and then specify their partial filters using the bson syntax such as:

       

      mb.Entity<Customer()
        .HasIndex(a => a.PostCode)
        .HasCreateIndexOptions(new CreateIndexOptions<BsonDocument>(
           PartialFilterExpression = Builders<BsonDocument>.Filter.Eq(a => a["Country"], "UK"));

      Ideally they would be able to specify it using the correct type not BsonDocument to allow us to use EF's element name mapping and compile-time checking.

      Reported on the forums at https://www.mongodb.com/community/forums/t/ef-provider-support-for-hasindex-on-nested-objects/310463/5

              Assignee:
              Unassigned
              Reporter:
              Damien Guard
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: