I’m use collection.watch() return error [AbortError: Aborted]
use by Realm react-native
this code
const user = useUser()
useEffect(() => {
const setupChangeStream = async () => {
try {
const collection = user!
.mongoClient('mongodb-atlas')
.db('dev')
.collection('Job')
for await (const change of collection.watch()) {
// The change event will always represent a newly inserted perennial
const { documentKey, fullDocument } = change
console.log(`new document: ${documentKey}`, fullDocument)
}
} catch (error) {
console.error(error)
}
}
setupChangeStream()
}, [user])
I have set accordingly Examples of every step finished.
Thank you.