2 / 2
Jun 2024

Hi,
I’m trying to use the $ne operator on an object field in an Atlas Trigger Match expression, but without success. After reading this topic, i tried the following match expressions:

``
{
“fullDocumentBeforeChange.hospitalization.discharge_date”: null,
“updateDescription.updatedFields.hospitalization.discharge_date”: {
“$ne”: 0
}
}

{
“fullDocumentBeforeChange.hospitalization.discharge_date”: null,
“updateDescription.updatedFields.hospitalization.discharge_date”: {
“$ne”: 0
}
}

The first one never executes, and second one always executes even if `{ hospitalization: { discharge_date: 0 } } `. Basically, what am i doing wrong here? If "hospitalization" was a simple field instead of an object something like this would work perfectly:

{
“fullDocumentBeforeChange.hospitalization”: null,
“updateDescription.updatedFields.hospitalization”: {
“$ne”: 0
}
}

Thank you!

(correction of the original text)

Hi,
I’m trying to use the $ne operator on an object field in an Atlas Trigger Match expression, but without success. After reading this topic, i tried the following match expressions:

{ "fullDocumentBeforeChange.hospitalization.discharge_date": null, "updateDescription.updatedFields.hospitalization.discharge_date": { "$ne": 0 } }
{ "fullDocumentBeforeChange.hospitalization.discharge_date": null, "updateDescription.updatedFields.hospitalization.discharge_date": { "$ne": 0 } }

The first one never executes, and second one always executes even if { hospitalization: { discharge_date: 0 } } .

Basically, what am i doing wrong here? If “hospitalization” was a simple field instead of an object something like this would work perfectly:

{ "fullDocumentBeforeChange.hospitalization": null, "updateDescription.updatedFields.hospitalization": { "$ne": 0 } }

Thank you!