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
Add default value to Schema #69
Labels
enhancement
New feature or request
Comments
Something like this? class Album extends Entity { };
const schema = new Schema(Album)
schema.definition // { redis: { type: "string" } } |
Thinking this: const schema = new Schema(Album, {
artist: { type: 'string', default: 'Mushroomhead' },
year: { type: 'number', default: 2020 }
} |
and
one more thing how to add another schema in type array { |
This has been asked for in several other issues and I am actively working on it. |
@guyroyse Any news? |
Code for nested objects in JSON is done and in a review process. Should be released next week when I get back from a conference. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It'd be nice to provide a default value to a Schema so that when an Entity is created, you don't have to set a field if you don't want to. Requested by @nraychaudhuri.
The text was updated successfully, but these errors were encountered: