I currently am able to Create, Retrieve and Delete documents with my current couchbase-lite setup with Android no problem. The issue I am having is that if I update a “workout” on one device, when I move to another device and hit refresh and run this query again the update disappears on the other device. Any idea why the workout would not update on both devices? It only updates on the device where I made the update
Here is my Query Code:
public static Query getWorkouts(Database database) {
View view = database.getView("workout/workouts");
if(view.getMap() == null) {
view.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
if (document.get("type") != null) {
if (document.get("type").equals("workout8")) {
emitter.emit("aaaaa", document.get("_id"));
int a = 0;
}
}
}
}, "44");
}
Query query = view.createQuery();
query.setIndexUpdateMode(Query.IndexUpdateMode.AFTER);
return query;
}