Hi Guarav, you've a bidirectional relationship, so the easiest way is using Graph API.
Lvc@ On 19 March 2014 06:43, Gaurav Dhiman <[email protected]> wrote: > > > On Friday, March 7, 2014 5:24:18 PM UTC+5:30, Andrey Lomakin wrote: > >> Hi, >> You do not need to insert them as separate insertions. >> Just create all objects at once and store root document everything will >> be stored and links will be updated automatically. >> >> > Hi Andrey, > > Can you explain above statements more with an example ? > > Lets say, there are three classes: > Person, Emails, Phones > > with below two way linking in Document based DB > Person (1) <----> Emails (N) > Person (1) <----> Phones (N) > > Person.emails is linkset to records in Emails class > Emails.person is link to record in Person class > > Person.phones is linkset to records in Phones class > Phones.person is link to record in Person class > > > Given above situation, what is the best way to insert these documents with > all inter-linking done. Performance and consistency are both important to > consider. > > I will appreciate if you can give one example code. > > Regards, > Gaurav > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
