Back

How to know the document updater using functions Event

  • 0
  • Databases
  • Flutter
  • Functions
  • Cloud
George Sadek
18 Sep, 2024, 12:27

I want to log each admin actions, so when an admin creates, updates or deletes a document, the functions occurs logging the admin and the modified document's details.

TL;DR
Developers can utilize Appwrite events with the pattern `databases.*.collections.*.documents.*`. Currently, there's no direct way to identify who triggered the event, but this issue is being tracked on GitHub. As a workaround, wrapping the collection update inside a function can help achieve logging each admin action on document creation, update, or deletion, capturing admin details and document modifications.
George Sadek
18 Sep, 2024, 12:40

How to know the document updater using functions Event

Binyamin
18 Sep, 2024, 13:49

You can use Appwrite events this one databases.*.collections.*.documents.* to be exact.

But, this event will emit in any collection change regarding the user.

As of now, there's no way to know who triggered the event.

For the updatedBy attribute track this issue.

The best option now would be to wrap the collection update inside a function.

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