[CSHARP-64] Add strongly typed CreateIndex() methods Created: 14/Sep/10 Updated: 19/Oct/16 Resolved: 20/Oct/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | SAMUS |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Oliver Weichhold | Assignee: | Sam Corder |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| 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>(); |
| Comments |
| Comment by Steve Wagner [ 20/Oct/10 ] |
|
Migrated to GitHub http://github.com/mongodb-csharp/mongodb-csharp/issues/issue/9 |
| Comment by Oliver Weichhold [ 14/Sep/10 ] |
|
I took the liberty and implemented it myself against the latest HEAD. Perhaps its of some use. Usage: public class User public string Username { get; set; } public string Password { get; set; }} var col = db.GetCollection<User>(); // Single Column Index // Composite Index , "idx_username_password", true, IndexDirection.Ascending); |