lowdb-api
lowdb-api copied to clipboard
Feature: Store resource data under a `data` key
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
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?
Will continue the discussion here: #2