mongolite icon indicating copy to clipboard operation
mongolite copied to clipboard

watch() style function to access $changeStream cursor for changes/inserts

Open vincentmajor opened this issue 6 years ago • 0 comments

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!

vincentmajor avatar Aug 15 '18 16:08 vincentmajor