Document.js
module.exports = {
attributes: {
type: {
type: 'string'
},
createdBy: {
model: 'User',
required: true
},
body: {
type: 'string'
},
comments: {
model: 'Comments'
},
metaInfo: {
type: 'json'
}
}
};
I would like to know if there is any way that I can write a model like the one given above, so that, I can add a json object to metaInfo which contains a name-value pair.
Eg: json: { name: 'Project', value: 'MyFirstProject'}
Is this possible through waterline?
Thanks in advance.
I believe the comment answers your question. If you need any further help, you can refer the answers in this issue raised in Sails Github page: JSON Array of Strings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With