[JAVA-546] ensureIndex not working with Java driver. Created: 27/Mar/12 Updated: 11/Sep/19 Resolved: 27/Mar/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | prudhvi chaganti | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | ensureIndex, java, | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 |
||
| Description |
|
Hi, I am trying to use ensureIndex for my collection using Java Driver of MongoDB. I want to have an unique index to be placed on my collection. I have used usercollection.ensureIndex(new BasicDBObject("id", 1).append("unique", true));. Please help me with the correct code to be used. |
| Comments |
| Comment by Jeffrey Yemin [ 27/Mar/12 ] | ||
|
Try
or
|