Hi Team,
I have created documents using Ottoman and Nodejs.
Example document structure given below:
{
"_type": “groups”,
“group_members”: [
{
"_type": “subscribers”,
"$ref": “7d4ab00e-26b8-45ae-93b9-9a4c1e29e584”
},
{
"_type": “subscribers”,
"$ref": “10ce32d6-252e-41d4-b63a-cf240740eb27”
},
{
"_type": “subscribers”,
"$ref": “f98aaaa6-dae3-4788-8983-cdeb1df26b25”
}
],
“channels”: [
“stores users email”
],
“created_on”: “2016-04-16T11:58:06.976Z”,
"_id": “be0790db-ebf4-4ebf-9e6e-d3ac5590576e”,
“group_name”: “Test Group”,
“created_by”: {
"_type": “users”,
"$ref": “f13368cf-7bb7-438b-b5e8-6638b9fa7273”
}
}
Now, I am trying to fetch these documents using pouchdb via sync gateway.
I also, tried to replicate the pouchdb document structure which has fields like “type”, “channels” and “_rev” etc.
However, was unable to create a document using the above fields as Ottoman doesn’t allow me to add fields like “type”, “_rev”.
(As in the above example Ottoman already adds “_type” object to the document which is same as the document “type” added explicitly when creating a document using pouchdb).
When trying to fetch these documents via sync gateway, in sync gateway logs it shows me error like “Unable to unmarshall data”.
So, how should I go about this issue?
Thanks and Regards,
Ajinkya.S.Udgirkar