Couchbase Lite One way sync

I don’t know what you mean by “for each document looping”.

I need to modify document to store targe ID which again creates conflicts right.

No, you put the relation in the document you create locally, referring to the immutable doc pulled from the server. There’s no need to modify the doc from the server. If you want to follow the relation backwards, create a view that indexes the link property.