Back

what's the syntax for getting realtime data from a database

  • 0
  • Databases
Drake
29 Jul, 2023, 01:05

you subscribed before updating the document?

how many times are you subscribing? are you subscribing to anythign else anywhere?

TL;DR
The user is asking for the syntax to get real-time data from a database. They are unsure if it should be a string or a map. They express concern about using an index for filtering because it may result in incorrect data. They receive advice to pick out necessary data on the client side. They also inquire about using real-time in an asynchronous Dart cloud function and ask for hints on how to implement it. They express appreciation for the support and mention future support for the Appwrite ecosystem. There is a discussion about debugging and app refreshing to test real-time data flow. No solution is provided in the thread.
dammy
29 Jul, 2023, 01:07

I subscribed before updating

I wrote subscribe code once, but I do recurrent app refresh to see if it's working.

Drake
29 Jul, 2023, 01:08

I do recurrent app refresh to see if it's working.

What do you mean?

dammy
29 Jul, 2023, 01:08

That's, i restart the app to see if real-time flow of data is coming in

Drake
29 Jul, 2023, 01:09

take a look at your recording at 18 seconds before you restarted the app. look at the debug console. you'll see the event printed

Drake
29 Jul, 2023, 01:10

when you restarted the app, you cleared away the debug logs

Drake
29 Jul, 2023, 01:11

Appwrite's realtime works by executing the callback when the event occurs

dammy
29 Jul, 2023, 01:11

Oooo, that's true, I didn't even notice it

dammy
29 Jul, 2023, 01:14

works, I appreciate you man

I never knew I was at the verge of it working

I appreciate your tireless efforts towards my project

I'll be willing to support the appwrite ecosystem in the future as I make business profit, I'm moved by the love I enjoy from you all @Steven @safwan @Maniac_Fighter @Binyamin @others

dammy
29 Jul, 2023, 01:17

Please sir one more thing, will the real-time work for a dart cloud function that is asynchronous and awaiting a response from an API?

If yes, kindly give an hint of how it should be.

I appreciate you always Sir @Steven Apologies for taking your time

Drake
29 Jul, 2023, 01:34

Would you please clarify what you mean? What are your trying to do with realtime in Appwrite functions?

dammy
29 Jul, 2023, 02:09

To get status of a payment made by customer to know if it's successful or failed or pending.

dammy
29 Jul, 2023, 02:43

Am getting a long data stream since it's getting all the content of the document, can't I just get the variable for a particular attribute

Drake
29 Jul, 2023, 02:45

Not at the moment. You can pick out what you need client side

dammy
29 Jul, 2023, 02:53

Yes, am thinking of how to do the filtering

dammy
29 Jul, 2023, 02:53

Cause if I use index and customer balance (string length increases with other attributes), I'll start getting wrong data later

Drake
29 Jul, 2023, 02:59

What do you mean?

dammy
29 Jul, 2023, 03:40

User balance may change from 100 to 10000 the change in length will affect my string filter if I do so via index

Drake
29 Jul, 2023, 03:43

What do you mean by index?

dammy
29 Jul, 2023, 05:02

the index number for each string value @Steven

Drake
29 Jul, 2023, 05:26

Uhh. It should be a map...just like if you were using the data attribute from a Document

dammy
29 Jul, 2023, 16:37

Ooo, really

dammy
29 Jul, 2023, 16:40

You're right Sir, I appreciate you dearly, and I never knew Sir

dammy
29 Jul, 2023, 16:53

Was thinking it's ordinary string

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more