[GODRIVER-1122] Index creation failed when the index name is empty Created: 11/Jun/19 Updated: 27/Oct/23 Resolved: 29/Jul/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tiansheng Ren | Assignee: | Isabella Siu (Inactive) |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
mongo client support create index allow index name emtpy. but driver return "index name cannot be empty" |
| Comments |
| Comment by Isabella Siu (Inactive) [ 08/Jul/19 ] | ||||||||||||||||||||||||||||||||||||||
|
Hi reage, If name is an empty string and you want to create an index, you should leave IndexOptions.Name nil. If IndexOptions.Name is nil the driver will generate an index name for you.
| ||||||||||||||||||||||||||||||||||||||
| Comment by Tiansheng Ren [ 04/Jul/19 ] | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| Comment by Isabella Siu (Inactive) [ 17/Jun/19 ] | ||||||||||||||||||||||||||||||||||||||
|
Hi reage, Can you give us an example of code that produces this error? | ||||||||||||||||||||||||||||||||||||||
| Comment by Tiansheng Ren [ 11/Jun/19 ] | ||||||||||||||||||||||||||||||||||||||
|
mongodb v4.1.13 use replica-set
mongodb driver version: v1.0.0-rc1+prerelease |