Schema
You can create schemas using with @esosdb/utils
Setup
models/UserSchema.js
Syntax
Schema Name; Schema name is a string and required.
Schema Props; Schema props is an object and required.
Timestamps; Timestamps is boolean and not required.
Example
models/UserSchema.js
It's created an Id per user, however you can create custom Id you want
Just add it to userSchema
In TS you need to write it as undefined including the "required:false" parts, to help us solve this: https://github.com/esosdb/utils/issues.
Last updated