I'm migrating from Legacy Realm and its Realm.Sync listeners to Change Streams and I'm trying to figure out how to easily fetch the full objects returned on update.
case "update": {
const { documentKey, fullDocument } = change;
console.log(`updated document: ${documentKey}`, fullDocument);
break;
}
Is there a way to fetch the full document with the relationship data?
For example the fullDocument
:
{
"_id": "b03dcd5d-94dc-7254-6aff-44d5818390ca",
"_partition": "test"
"Message": "Test",
"Sender": "51f717ad-afbc-c3d6-779a-72db53f8b708",
"SeenBy": [
"51f717ad-afbc-c3d6-779a-72db53f8b708"
],
}
Instead of the Sender
id, I want to get the sender document, same thing in SeenBy
.
{
"_id": "b03dcd5d-94dc-7254-6aff-44d5818390ca",
"_partition": "test"
"Message": "Test",
"Sender": {"_id": "51f717ad-afbc-c3d6-779a-72db53f8b708", "Name":"John"},
"SeenBy": [
{"_id": "51f717ad-afbc-c3d6-779a-72db53f8b708", "Name":"John"}
],
}