Realm database trigger doesn't work for some databases

Hi, I have 3 databases with, let’s say, db, db-v2 and other names. They all have a collection, let’s say collection. When I try to add a database trigger with insert, update and delete types the trigger doesn’t work for db and db-v2, however it works for the other. I tried to edit trigger and toggle its parameters and I tried other collections but without any success.

The other strange thing is that when I add MongoDB trigger which creates a Realm app for himself - everything works just fine.

Any clues or advice? :thinking:

A Database Trigger is bound to be fired on a specific collection, on a specific database: if the connected function is supposed to be called on different databases, even though the collection name is the same, you need to create 3 different triggers, each connected to the relevant DB (but all 3 of them can recall the same function, if needed, as long as the function knows the DB it’s working on).

If the above is the case, have you looked into the Logs, and checked that the functions are running without errors?

Thanks for your response @Paolo_Manna , it wasn’t the case I tried to use my trigger on all different collections while changing/inserting objects to them but for some reason, only one collection was working at that time. Today it just works on all collections :exploding_head:. Maybe restarting sync helped or I don’t know just the other phase of the Moon :rofl:

On the other hand, I just tried to play with the trigger and noticed that it doesn’t work when I update a field in the array field. I have object like this:

{ ts: [{ i: ObjectId, t: 1.1 }], e: true }