[JAVA-246] Enable own _id usage Created: 31/Dec/10 Updated: 17/Mar/11 Resolved: 31/Dec/10 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Laszlo Solova | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I would like to use own _id instead built-in ObjectId, as described in main mongodb documentation. It is overwritten on insert, so I could not save my own id. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 31/Dec/10 ] |
|
save() should do the same thing (just confirmed its working as expected) |
| Comment by Laszlo Solova [ 31/Dec/10 ] |
|
I'm sorry, I'm beginner in Mongo and tried DBCollection save(DBObject jo) method, and there was my _id overwritten. If I use insert, it works. |
| Comment by Eliot Horowitz (Inactive) [ 31/Dec/10 ] |
|
You just have to set _id before calling insert. |