backand - How to insert mant-to-many object -
i have 2 structures similar pests-owners, structure:
{ "name": "contratti", "fields": { "rischicontratti": { "collection": "rischicontratti", "via": "contratti" }, "intervento": { "collection": "interventi", "via": "contratto" }, "numero": { "type": "string" }, "impresa": { "object": "imprese" }, "oggetto": { "type": "string" } }, { "name": "rischicontratti", "fields": { "contratti": { "object": "contratti" }, "rischio": { "object": "rischi" } } }, { "name": "rischi", "fields": { "rischicontratti": { "collection": "rischicontratti", "via": "rischio" }, "rischi_interventi": { "collection": "rischi_interventi", "via": "rischio" }, "rischio": { "type": "string" } }
when i'm inserting contratto want insert related rischi. there way post in 1 call? or have post first contratto , loop each rischi?
Comments
Post a Comment