When I try the following code given on firebase documentation
doc_ref = db.collection(u'users')
def on_snapshot(doc_snapshot, changes, read_time):
for change in changes:
print(u'new doc:{}'.format(change.document.id))
doc_watch = doc_ref.on_snapshot(on_snapshot)
It prints all the entries even if they already existed before I invoked the listener. I only want to listen to the changes that take place after the listener is invoked and ignore any entries that already exited before I invoked the listener.
Example : if i had 3 documents in my users collection : user1, user2 and user3 already. I run my program and add another document - user4. I my program to print user4 and not user1, user2 or user3.