Remove default field “doc” that gets added by Couchbase while doing XDCR

We are trying to remove “doc” field which gets added on top of original document by Couchbase while doing XDCR.

For example:

Below is our sample original document :-

{
   "UserID": "User1",
   "FirstName": "First",
   "LastName": "Last",
   "Roles":
   [
     {
       "RoleID" : "1",
       "RoleName": "R_1"
     }
   ]
} 

But when we do XDCR from Couchbase to ElasticSearch, Couchbase adds “doc” field which holds the original document. Below is the sample document created by Couchbase XDCR :-

{
   "doc":
   {
       "UserID": "User1",
       "FirstName": "First",
       "LastName": "Last",
       "Roles":
       [
         {
           "RoleID" : "1",
           "RoleName": "R_1"
         }
       ]
    } 
}

Is there a way to remove this “doc” field?

Thanks,
Sameer

Hi Sameer,

There’s no way to change this in the current version of the plugin, it’s hardcoded. Could you please open a feature request for this, so it will go into the next release?

Hi, I am using CB Enterprise 5.0 and transport plugin 5.6.4 (for elastic search) and still seeing type mapping for field ‘doc’. Means it is not resolved yet ?

Thanks
Divya

Kindly let me know if can remove it(doc) anyway ? Any workaround possible?
Tried some tricks in plugins/transport-couchbase/couchbase_template.json but not worked.

Thanks in advance!
Divya Garg