Skip to content

Cannot provide my own id #2

@alblandino

Description

@alblandino

The structure you use to save the resources automatically generates an incremental ID, in which case you want to save this:

{
    id: 100,
    fname: "Joel",
    lname: "Jaime"
}

I simply omit the ID field since I would try to replace the one generated by lowdb-api.

One suggestion would be that instead of an incremental ID you generate a kind of {_id: guid_format} (or any unique data) or have the identifier inside protected object:

{
    core: {
        id : AUTOGENERATED_ID
    },
    fname: "Joel",
    lname: "Jaime"
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions