[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.
Maybe a new UserId interface could be used to support this feature.



 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.
Thank you for your suggestion.

Comment by Eliot Horowitz (Inactive) [ 31/Dec/10 ]

You just have to set _id before calling insert.
If you find that doesn't work for you, please attach your code and results.

Generated at Thu Feb 08 08:51:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.