Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2590

Collection.watch() error Aborted on React Native SDK

      How frequently does the bug occur?

      Always

      Description

      I’m need get data change realtime

      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.

      [https://www.mongodb.com/docs/realm/sdk/react-native/app-services/query-mongodb/#real-time-change-notifications|url]

      Thank you.

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      [AbortError: Aborted]
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      12.1.0

      What services are you using?

      Atlas Device Sync

      Are you using encryption?

      Yes

      Platform OS and version(s)

      All platform

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: