镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Using customized _id ( not objectid) #19

Open

Description

@mfatemipour

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.

Activity

  1. samuelpcabral commented on May 14, 2019

    @samuelpcabral

    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"}}

  2. mfatemipour commented on Jul 17, 2019

    @mfatemipour
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions