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

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -