Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-64

Add strongly typed CreateIndex() methods

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • SAMUS
    • None

    Description

      The current way of creating indexes using string arguments is neither intuitive nor provides it compile time checking. It would be good to be able to create indexes in a strongly typed fashion.

      var col = db.GetCollection<User>();
      var meta = col.Metadata;
      col.CreateIndex(x => x.Username, "idx_username", true, IndexOption.Ascending);

      Attachments

        1. 0001-CreateIndex.patch
          5 kB
        2. 0002-CreateIndex.patch
          0.9 kB

        Activity

          People

            sam Sam Corder
            oliverw Oliver Weichhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: