Skip to content

ObjectId #4

Open
Open
@agsh

Description

@agsh

Do you plan to add a generator for object_ids on the client side?
Without this function when I need an object_id of the last inserted
object I do this:

mongo:insert(Collection, Doc),
Query = [$query-Doc, $orderby-['_id'-(-1)]],
mongo:find_one(Collection, Query, ['_id'-1], ['_id'-object_id(NewRef)]),

But this is ugly...
PS I have checked that mongo:insert allows to set _id on the client
side. It works fine with new _id but does nothing when _id is already
present in db. I think in this case it shall fail with a message or
something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions