Hi all,
I’m new to the community.
I currently have an issue/problem where I’m struggling with. Maybe somebody has a good hint for me
Enviroment:
MongoDB Realm
Version: 4.4.6
CLUSTER TIER: M0 Sandbox (General)
REGION: AWS / N. Virginia (us-east-1)
Description:
I want to watch out for changes in a special collection like in my example „User“-Collection.
Therefore I use a trigger in MongoDB Realm, which checks if a new entry will be inserted to the „User“ Collection.
If an entry will be inserted, the Trigger is firing and forwarding the „FullDocument“ to a Mongo-Function which will do some checks and further manipulation.
The (inserted) document in the collection has the following content as you can see in the enclosed example-dataset:
{
_id: "606f48f6308c87387b529f17",
name: „Thomas“,
friends: [
{
status: "Open",
friend_userId:"606870420b4920e213f004b9",
friend_username:“Sam“,
},
{
status: "Open",
friend_userId:“32rfd3sddsfb4920e21dsdsfg“,
friend_username:“William“,
}
],
created_by: "606870420b4920e213f004b9",
}
Problem/Issue:
The „FullDocument“ within the Mongo-Function is receiving all the properties correctly and I can work with it, the only part of the document which is not included in the „FullDocument“ is the embedded array of Objects „friends“.
This object is unfortunately missing in the transmitted „FullDocument“ like you can see below:
{
_id: "606f48f6308c87387b529f17",
name: „Thomas“,
created_by: "606870420b4920e213f004b9",
}
Somebody already had the same issue or is it generally not possible to pass embedded arrays of Objects via „FullDocument“ to a Mongo-Function?
Thanks in advance and BR
JD