I have observed that an “_id” and “_rev” attribute seems to be added to my documents after they have been sync’ed. The “_id” contains the same key as META().id and “_rev” the same info as the meta xattr. sync. rev field.
… I see that some places in the documentation it is mentioned that these fields get added during sync. But do I need to concern myself about them when using e.g. upsert() ??
You should not have to be concerned about that. All mutations made through the server will be imported and processed by the Sync Gateway for sync ).You can read a bit more about it here