Hi
I am new to node and loopback.
by referring to loopback documentation, i am trying to create a new model with mongodb as the datastore.
In mongo db i want to store a de-normalized customer-address information where one customer can have multiple addresses, something like
{
_id:{type: Number},
FirstName:{type:String},
LastName: {type:String},
Address:[{
AddressType:{type:String},
AddressLine:{type:String}
}]
}
How will I create a model for this?
started with slc loobkac:model but got stuck on how to define the object, when property type is "object".
{
"name": "Customer",
"plural": "Customers",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"_id": {
"type": "Number",
"required": true
},
"Address": {
"type": "object"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": []
}
Thanks
Vijay