I have tow models: Order and Service:
Order = db.define('order', {
id,
....
})
Service = db.define('service', {
id,
....
})
and I have make a hasMany to expression order could have many services:
Order.hasMany('service', Service, {
service_id: 'number',
order_id: 'number'
}, {
autoFetch: true
});
when I use:
order.addService(server)
everything gos well, but when I use getService:
order.getService(function(err, services){
//here, the services is a one element array, this element is the first line of order table. I can't understand it.
})
Could anyone tell me how to debug or fix this?
Thanks!