[CSHARP-1575] Better way to create indexes Created: 21/Feb/16 Updated: 24/Mar/16 Resolved: 24/Mar/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Zeioth | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | index, indexes | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Hi, I just upgraded from 1.9 to 2.2 and i think the new changes are great. Said this, I think there's room for improvement in the process of create indexes. This is my wrapper of indexes.CreateOne(). As you can see, there's no general way to tell a to the method if an index key is ascending or descending. So, what do you think about this kind of implementation? |
| Comments |
| Comment by Zeioth [ 23/Feb/16 ] | |
|
Yes Craig thank you so much. This solution has significantly less bloat code. Then I think this issue is closed. | |
| Comment by Craig Wilson [ 23/Feb/16 ] | |
|
Hi Zeioth, This is what I think you are saying: The direction of the indexes is indicated by the method name and not a parameter. I believe this is possible by using a BsonDocument and let that get automatically converted to an IndexKeyDefinition<TDocument>.
Does this satisfy your need? |