Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using customized _id ( not objectid) #19

Open
mfatemipour opened this issue May 14, 2019 · 2 comments
Open

Using customized _id ( not objectid) #19

mfatemipour opened this issue May 14, 2019 · 2 comments

Comments

@mfatemipour
Copy link

I want to use my own string id (is allowed in mongodb) as _id when saving documents, but library always try to convert that id to objectid and therefor it fails.

@samuelpcabral
Copy link

Hi @mfs-git i use my own string id in mongodb too, try this one:

inside json, instead to pass the id like {"_id" : ObjectId("000000000000000000000001")}
try send in this way: {"_id" : {"$oid" : "000000000000000000000001"}}

@mfatemipour
Copy link
Author

Hi @samuelpcabral, I solve my problem with changing some code in project
https://github.com/mfs-git/Robotframework-MongoDB-Library/tree/c3fd2449cb398a652f71f8199742d791e27e16f7

But it is better to remain on main repositoy, I will try your solution, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants