mongodb / stitch-js-sdk

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

should RemoteMongoCollection.watch work when using MongoDB Stitch React Native SDK? #348

Closed hayate closed 4 years ago

hayate commented 4 years ago

In the documentation here: https://docs.mongodb.com/stitch-sdks/js-react-native/4/classes/stream.html it says that it is possible to watch to a remote MongoDB for changes using a call to RemoteMongoCollection.watch

I was trying the functionality but the watch method is undefined, in fact, I don't see it here https://docs.mongodb.com/stitch-sdks/js-react-native/4/interfaces/remotemongocollection.html or here https://github.com/mongodb/stitch-js-sdk/blob/master/packages/react-native/services/mongodb-remote/src/RemoteMongoCollection.ts

Is the watch method not available for Stitch React Native SDK? Is there a way to watch for changes from a remote MongoDB Atlas using Stitch in react-native?

tDuy commented 4 years ago

React Native SDK is way behind... It doesn't has custom user data too.

react-native-community/discussions-and-proposals#99 (comment) It seems to me that we have to wait for React Native 0.62

adamchel commented 4 years ago

@tDuy is correct. We will not be able to support watching change streams in the React Native SDK until React Native 0.62 is released. Sometime after that happens, I will create a React Native EventSource library using the newly exposed network primitives in 0.62, and we will update the Stitch React Native SDK to support watching change streams.

adamchel commented 4 years ago

Hey everyone, we've just released experimental watch support for React Native! See https://github.com/mongodb/stitch-js-sdk/releases/tag/v4.9.0 for details on how you can use it. We can release this non-experimentally once React Native 0.62 is officially released.

If you have any problems with it, feel free to open a new issue!