mongolite
mongolite copied to clipboard
watch() style function to access $changeStream cursor for changes/inserts
Hi,
I'm developing a Mongo streaming pipelines with mostly Python services but one or two R based services and I'm wondering if there is any way in mongolite to create a $changeStream
cursor for changes, or more specifically, inserts similar to that in pymongo's Collection.watch()
, e.g.:
with db.collection.watch( [{'$match': {'operationType': 'insert'}}] ) as stream:
for insert_change in stream:
print(insert_change)
Thanks a lot!