Skip to content

Conversation

@alblandino
Copy link

I am adding a new index called data to protect the self-generated id in case the user adds a field ID

For example, I am sending these values:

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

I receive and storage the values in this way:

{
    id: 1,
    data: {
        id: 12,
        fname: "Joel",
        lname: "Jaime"
    }
}

The behavior of the module is the same, the only thing that in this case allows the user to save his own ID of his application since by default lowdb does not allow a dynamic ID

@rmariuzzo
Copy link
Owner

Hey @jblandino! Nice to see you there mate! Would not be better to allow user specify the id if they want to? I think it is more simple and straightforward to allow the user to provide and id or let the api to auto generate one.

What do you think?

@rmariuzzo
Copy link
Owner

Will continue the discussion here: #2

@rmariuzzo rmariuzzo changed the title Adding the data under an index Feature: Store resource data under a key Oct 31, 2017
@rmariuzzo rmariuzzo changed the title Feature: Store resource data under a key Feature: Store resource data under a data key Oct 31, 2017
@rmariuzzo rmariuzzo closed this Dec 13, 2017
@rmariuzzo rmariuzzo reopened this Dec 13, 2017
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

Successfully merging this pull request may close these issues.

2 participants