Back

[SOLVED] how to know if the document was created, updated or deleted in realtime payload?

  • 0
  • Databases
  • Realtime
  • Web
manazo
10 Nov, 2023, 17:02

i'm working on a chat system, and have a realtime connection in the chat. so when i get a response in the realtime callback, i need to check if the new document was created, updated, or deleted to show users the corresponding message. is there any way to check that?

Appwrite: Cloud App: NextJS

TL;DR
The user asked how to determine if a document was created, updated, or deleted in a realtime payload. The response from Appwrite explained that the event in the payload should indicate if it's a create, update, or delete action. The user mentioned they are working on a chat system and need to show users the corresponding message based on whether the document was created, updated, or deleted. The solution provided by Appwrite is to check the event in the realtime callback to determine the action.
Drake
13 Nov, 2023, 21:17

The event should tell you if it's a create, update, or delete. See https://appwrite.io/docs/apis/realtime#payload

manazo
14 Nov, 2023, 08:30

[SOLVED] how to know if the document was created, updated or deleted in realtime payload?

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