jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
286 stars 65 forks source link

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

Open vincentmajor opened 6 years ago

vincentmajor commented 6 years ago

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!