1 / 1
Aug 2024

Hi,

I’m facing an issue when updating a document from a Realm/Atlas Device Sync and getting the complete fullDocumentBeforeChange data.

The problem:
I have a trigger with a config that looks like this:

{ "name": "MyTrigger", "type": "DATABASE", "config": { "operation_types": ["UPDATE"], ... "match": { "operationType": "update", "updateDescription.updatedFields.myField": { "$exists": true } }, "project": { "operationType": 1, "fullDocumentBeforeChange": { "myField": 1 } }, "full_document": false, "full_document_before_change": true, "unordered": false }, "disabled": false, "event_processors": { "FUNCTION": { "config": { "function_name": "myFunctionName" } } } }

I’ve also tried changing the project config to fullDocumentBeforeChange: 1 , but the result was that other fields were there, but not myField .

I’ve tested by manually changing the value from myField in the database, and in that case it works fine, but if I do it from Atlas Device Sync, it doesn’t.

Change event output example:

With Atlas Device Sync { ..., "fullDocumentBeforeChange": {} }
With MongoDB Compass { ..., "fullDocumentBeforeChange": { "myField": "my field value before change" } }