There is a Couchbase server bucket that contains location data of a person, let’s say P1, for past one month. The location data is continuously getting added to that bucket as and when the person’s location changes. There is a separate service of mine which pushes this data onto the Couchbase server.
Secondly, there is a CBLite Android application of mine which can sync documents (location data) via Sync gateway. It is configured to receive from a channel which contains only P1’s data.
Below are my requirements:
i. Suppose App is connected now to sync gateway for the very first time. It only wants P1’s location data that is received now onwards. In other words, whole one month’s location data is not needed to be synced. Right now, it is syncing whole location data.
ii. Suppose App was connected but went offline for a certain duration, then when it comes back online and connects to sync gateway again, location data collected when App was offline also needs to be synced.
How to achieve this?