sync_gateway and ottoman driven shadow unable to sync

#1

I am developing and application that will have a mobile part with couchbase lite that connects via a sync gateway to a couchbase_server. The data on the couchbase_server is going to be administered though a web app with an ottoman backend. When I start the sync_gateway I get the following error:
Error applying change from external bucket: 400 user defined top level properties beginning with '_' are not allowed in document body
Ottoman insists on adding a property called _type to each document and if I understand correctly this is the problem.
Is there a way to get this two to work together, either instructing ottoman to use type instead of _type or by configuring the sync_gateway to accept _type? Or the problem is somewhere else?

My config.json looks like this at the moment:

{
  "interface":":4984",       
  "adminInterface":":4985",
  "log":["CRUD+", "REST+", "Changes+", "Attach+", "Shadow"],
  "databases":{              
    "reserver_app_syncgw":{
        "server":"http://localhost:8091",
        "bucket":"sync_gateway",
        "sync":\`
                function (doc) {
                channel (doc.channels);
            }\`,
        "users": {
                "GUEST": {
                    "disabled": false,
                    "admin_channels": ["*"]
                }
            },
        "shadow": {
                "server": "http://localhost:8091",
                "bucket": "reserver_app"
        }
    }
  }
}

Thanks

#2

Sync Gateway doesn’t support user-defined properties starting with underscore (required for Couch DB compatibility).

@brett19 Can you help out on whether there’s a way to change the naming of the _type property in ottoman?

#3

Hey @jgarcia, @adamf,
We have started to try and allow this kind of change, but currently it is not possible to change _type to be anything else. Note that _id is changeable on a per-model basis by adjusting the ‘idField’ option on the model.
Cheers, Brett

#4

To bad, I think Ottoman is a very important addition to the Couchbase toolkit, but for us it is essential that is compatible with the Sync Gateway. Maybe some kind of global configuration setting but after looking at the source _type seems to be hard coded in a lot of places. I guess we will have to do the backend the hard way then.