Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Store resource data under a data key #3

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Feature: Store resource data under a data key #3

wants to merge 2 commits into from

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.

None yet

2 participants