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

Add strongly typed CreateIndex() methods

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: SAMUS
    • Labels:
      None

      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);

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

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

              Created:
              Updated:
              Resolved: