mongodb / stitch-js-sdk

MongoDB Stitch JavaScript SDK
Apache License 2.0
113 stars 67 forks source link

Streaming interface #36

Closed zacharynevin closed 6 years ago

zacharynevin commented 7 years ago

Is it possible to give mongo stitch a streaming interface for mongodb operations? If not, is this something that is planned?

For example:

let cursor = db.collection('mycollection').find({})

In the native mongodb js library, this would return a cursor in which I can do:

cursor.on('data', (datum) => { 
  // do stuff
}

Thanks so much!

edaniels commented 7 years ago

There are plans in the future to do this by having Stitch leverage change streams in MongoDB 3.6. Some basic details about that for just MongoDB are here: http://mongodb.github.io/mongo-java-driver/3.6/driver/tutorials/change-streams/