Reputation: 111
I have a local database in Android with some data that contains timestamp. And I have a firebase database that contains same data. Now if I update data in firebase database, suppose I update name and timestamp updated automatically. App also maintains last sync time in preference.
How do I retrieve all data from firebase where timestamp in firebase is greater than timestamp in preference ?
Upvotes: 8
Views: 4994
Reputation: 598740
Something like this:
Query query = ref.orderByChild("lastUpdatedTimestamp").startAt("1490187991");
I'm not sure why you store the timestamp as a string btw. I recommend converting that to a number, so that you don't get caught when we reach the 11th digit (which admittedly will take quite some time).
Upvotes: 11