In Firestore or Realtime Database, how many active users can listen for changes to the same document simultaneously? For instance, if 1000 users are subscribed to updates on a single field within a document, will all users reliably receive notifications when that field is updated? Are there any limits to the number of listeners per document or per field, especially in terms of scalability?
const docRef = firestore.collection('col').doc('doc');
// Subscribe to changes on a specific field in the document
docRef.onSnapshot((doc) => {
if (doc.exists) {
console.log('Document data:', doc.data());
} else {
console.log('Document does not exist');
}
}, (error) => {
console.error('Error fetching document:', error);
});