Question:
[How can I make the ID field as auto increment when each new user submit the registration form? .]
Product:
Wix Editor
Question:
[How can I make the ID field as auto increment when each new user submit the registration form? .]
Product:
Wix Editor
The _id
field is randomly generated every time a new item is inserted into a collection. However you can also manually specify your own _id on insert when using Velo and wix-data.
The basic way is something like:
_id
: https://www.wix.com/velo/reference/wix-data/wixdataquery/descendingconsistentRead
and omitTotalCount
options on the find()
call to get consistent reads and a bit more performance_id
of that item, increment by 1, and use that for the new itemMay also want to consider indexes to speed up these types of operations: CMS: Adding an Index for Your Collection | Help Center | Wix.com
Also may want to consider handling conflicts (ie. what if 2 writes are happening at the same time and trying to use the same id?).