Hi @Dominik_Jell, I didn’t see “embedded” being set in the code you shared.
To troubleshoot this, we really need sample code that’s following the instructions but isn’t working as expected. If we can reproduce a problem then it’s much easier to figure out what’s happening.
Thank you for your quick response, and all your many articles on using Realm. I would be nowhere without those resources. Here are the relevant object models:
I’m running a function on an Event insert and getting undefined when I look for “invitees” in the fullDocument object. I am sure that this field is being properly added to the inserted object because when I query the Events collection (just a simple eventsCollection.find()) from that same function, the document that is returned DOES include “invitees”
Note that if you set the trigger to fire on replace (in addition to insert) then it fires a second time when you add the Event object – invitees is there when the trigger fires the second time with the replace operation. So, it looks like the syncing of the new Object results in 2 database writes:
Insert the document without the embedded array
Replace the document – this time including the embedded array