We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ArrayType options are set to undefined even when you use some options.
undefined
Current behavior: Define schema like this:
const userSchema = new Schema({ test: {default: ()=>[], type: [{type: String, ref: 'Article'}]} });
Produce:
ArrayType { name: 'Article', typeName: 'Array', options: undefined, itemType: ReferenceType { name: '', typeName: 'Reference', options: undefined, schema: Schema { statics: {}, methods: {}, preHooks: {}, postHooks: {}, index: {}, queries: {}, options: [Object], fields: {} }, refModel: 'Article' } }
Notice: options were set to undefined
Correct behavior should be:
ArrayType { name: 'Article', typeName: 'Array', options: {default: ()=>[]}, itemType: ReferenceType { name: '', typeName: 'Reference', options: undefined, schema: Schema { statics: {}, methods: {}, preHooks: {}, postHooks: {}, index: {}, queries: {}, options: [Object], fields: {} }, refModel: 'Article' } }
Notice: options has the default value set (options: {default: ()=>[]},)
options: {default: ()=>[]},
The text was updated successfully, but these errors were encountered:
fix(schema): set correct options for ArrayType
ac27df0
Closes: #716
2f05828
Successfully merging a pull request may close this issue.
ArrayType options are set to
undefined
even when you use some options.Current behavior:
Define schema like this:
Produce:
Notice: options were set to
undefined
Correct behavior should be:
Notice: options has the default value set (
options: {default: ()=>[]},
)The text was updated successfully, but these errors were encountered: