Details
-
Improvement
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
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);