Is it possible to define anonymous models using the slc tools, or manually in json? For example I have a particular model member and want to have a reusable anonymous 'address' model, but not have that in a backend store, but added directly to the document. Mongoose provides functionality similar to this with no modeled schemas. If this is possible, where in the member.json file would I define this.
{
"name": "member",
"base": "PersistedModel",
"properties": {
"fullname": {
"type": "string",
"required": "true",
"length": "64",
"doc": "User's full name"
},
"displayname": {
"type": "string",
"required": "true",
"length": "64",
"doc": "User's display name"
},
"address": {
"type": [
"Address"
],
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": []
}
The solution was to use the "embedsMany" relation type.
"relations": {
"addresses": {
"model": "address",
"type": "embedsMany",
"options": {
"autoId": false,
"validate": true
}
}