I am using Firebase Cloud Functions on my Realtime Database. I am running a simple function to get the total users of my project but keep getting the same error:
The data requested exceeds the maximum size that can be accessed with a single request
Here is my code.
let collectionRef = admin.database().ref('users');
return collectionRef.once('value', function(snap) {
console.log('users: ' + snap.numChildren());
});
I estimated around 11,000 + users. Is there anyway to get the numChildren
of a specific location in the realtime database with such a large count?