Open italojs opened 2 years ago
use objectID in ID field for the user(generated) entity;
I didn't understand. Could you proved a code example?
I'm sorry, maybe I'm not clear. We generate a random number for User.id as we do for SQL databases here, we could just define the id as string, so insert the User using a ObjectID id instead
change this:
<% if(!props.mongo){ %>ctx.<%- props.name.camelCase %>.id = Math.floor(Math.random() * 100000).toString()<% } %>
for this:
ctx.<%- props.name.camelCase %>.id = new ObjectId()
When we create a project, the entity ID is generated via a simple random number
We could improve it using ObjectID, it could be a default value for all databases: