Concurrent updates to diff subdocs in document


We have a document where there are multiple address (sub doc) in a doc and we might update this address concurrently using Golang.

{ FName:"a", Name:"b", Address:{ Address1:{ place:"". State:"", Pincode:"", }, Address2:{ place:"". State:"", Pincode:"", }, } }

we create 2 go routines to update Address1 and Address2 by passing Path. No go routine will update the same path but multiple go routines might access the same doc to update diff paths.

Like :- goroutine1 => Address.Address1, goroutine2=> Address.Address2 (both updates go to same doc)

So do we get some conflicts here if we just do it using Collection.MutateIn by giving path.

res, err := Collection.MutateIn("123#123", []gocb.MutateInSpec{gocb.UpsertSpec("Address.Address1", temp, nil)}, nil)