When I do :
realm.write(() => {
person.cars.push(mycar);
}
});
I receive a document with the index of the element that has been updated like
\"updateDescription\":{\"updatedFields\":{\"cars.1\":\"65f38ef80c055732995868c3\"}
However if I use unshift to add an element at the first position instead of using push (that add the element at the last position)
realm.write(() => {
person.cars.unshift(mycar);
}
});
the event that i receive does not contain the index part and become :
\"updateDescription\":{\"updatedFields\":{\"cars\":\"65f38ef80c055732995868c3\"}
For my use case using unshift instead of push fixed my issue
And my match expression is :
{“updateDescription.updatedFields.cars”:{“$exists”:true}}