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

Can not use string as object ID ? #39

Closed
windmaomao opened this issue Dec 20, 2014 · 6 comments
Closed

Can not use string as object ID ? #39

windmaomao opened this issue Dec 20, 2014 · 6 comments

Comments

@windmaomao
Copy link

I found this is interesting, if id is 54958d281a995 instead of an integer, it stop working.

@typicode
Copy link
Owner

Hi,

Thanks, that's interesting, I didn't try with hash ids. I used incremental ids (1, 2, 3...) to make it simpler from a user point of view.

Do you need json-server to support string as object ID or was it just a test?

@windmaomao
Copy link
Author

that'll be great, since noDB is not using 1,2,3 as id, it's harder to use it with integer only. When you try to add a record, you don't know what it'll be, so calling a unique id algorithm will add that.

the other thing which will be very helpful is to have a standalone PHP script to take care of rest api instead of node.js app. Because most of server is equipped with php by default. This will increase the usage of your library big time.

@eduardoinnorway
Copy link

I really need this feature... issues I have keys that looks like this as ID, 980067645AG
Really nice project.

@windmaomao
Copy link
Author

seems this is a good candidate for node.js, https://github.com/flosse/json-file-store, however you still need to setup a server/express to use it effectively. But the functionalities is pretty much what CRUD needs.

@typicode
Copy link
Owner

typicode commented Jan 6, 2015

hi @eduardoinnorway I'll try to come up with something.

Actually using https://github.com/typicode/lowdb for the JSON file database on JSON Server :)

@typicode
Copy link
Owner

typicode commented Feb 3, 2015

Sorry, it took some times but the feature is here now in v0.5.11.
In case, it can't generate an integer id, it falls back to using a uuid.

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

No branches or pull requests

3 participants