I need to keep my firebase database synchronized so i ve made a little search and i found out that i can use keepsynced(true) because by default, Firebase keeps 10mb data in cache and if it grows further it will replace by new data so i ve used it like so ( working with firebase on a node app on glitch)
var locationRef = admin
.database()
.ref()
.child("locations");
locationRef.keepSynced(true);
locationRef.once('value').then(function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var childKey = childSnapshot.key;
var childData = childSnapshot.val();
console.log(childData);
presseLocations.push(childData)
});
but i'm getting this error :
locationRef.keepSynced is not a function
Any idea ?