Hi,
For an enterprise android application, we had used SQLite architecture so far. This application collects specific data and uploads into the server. We were handling sync by ourselves. Now, as we looked into couchdb, we are interested in knowing how it works with respect to our application. While implementing, we got stuck and the following questions arise.
- Following the couchbase for android tutorial, I created a simple application, whose data gets replicated into couchbase server using sync gateway. After replication, I found some meta data which we intend to ignore. When I inserted the data, it was found to be in the following structure.
{
"_sync": {
“rev”: “1-5aca82e9-e4cc-47db-9cce-fe32fea68d1c”,
“sequence”: 1,
“history”: {
“revs”: [
“1-5aca82e9-e4cc-47db-9cce-fe32fea68d1c”
],
“parents”: [
-1
],
“bodies”: [
""
],
“channels”: [
null
]
},
“time_saved”: “2014-04-26T14:58:37.399871861+05:30”
},
“check”: false,
“created_at”: “25-04-14”,
“text”: “this is a demo”
}
In the above structure, our data were Check, created_at and text. In the server, I need only this structure to be noticed. But I could not get enough information in order to achieve this.
- After replication, I notice 4 documents per sync. Their document ID are as follows:
ID: 78e2c7dc-da9a-42f4-95a6-03bd6cea7b6e
Data: {
"_sync": {
“rev”: “1-5aca82e9-e4cc-47db-9cce-fe32fea68d1c”,
“sequence”: 1,
“history”: {
“revs”: [
“1-5aca82e9-e4cc-47db-9cce-fe32fea68d1c”
],
“parents”: [
-1
],
“bodies”: [
""
],
“channels”: [
null
]
},
“time_saved”: “2014-04-26T14:58:37.399871861+05:30”
},
“check”: false,
“created_at”: “25-04-14”,
“text”: “this is a demo”
}
ID: _sync:local:a7e278f189bb5954e0bae030cf2dd2b231a7318e
Data: {
"_rev": “0-1”,
“lastSequence”: “1”
}
ID: _sync:seq
Data: 5
ID: _sync:syncdata
Data: {
“Sync”: “function(doc) {channel(doc.channels);}”
}
I believe that the first data is recognized as bulk_docs. I’m using sync gateway during replication. How to achieve my requirement? I looked at the beer sample and the data seems to be represented in such a clean manner. But when I perform replication, these irregularities occur.