Advice on how to add an autoincrement ID #477
Unanswered
curiosport
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Each time a user registers on my website I add their information to the nutsdb database in the "users" bucket, but each user must have a unique ID on a first-come, first-served basis.
So the first user would have ID 1, the tenth to register would have ID 10, and so on, how can I know which ID corresponds to a n user?
I have been thinking about using the
Tx.ZCard
function, but its definition scared me a bit and I am not sure if it is the way to go, another idea I came up with is to create another bucket called "statics" every time a user registers the number of users in the "statics" bucket is updated and that way I get the ID that corresponds to the last user to register.Which is a good idea? do you have any other advice?
Beta Was this translation helpful? Give feedback.
All reactions