Hi all - I’m new to using Mongo so I apologize for anything that looks dumb. I handle updating my records with a Realms webhook that works perfectly, EXCEPT for when I try to update the arrays I store inside my DB objects.
Here is an example of a JSON post I am making to this webhook:
{
"objectID": "5fa0bdb636a703546ee07c52",
"id": "Joe",
"value": {
"id": "test",
"dob": "20-20",
"purchDate": "2020-09-02",
"purchFrom": "2020-09-02",
"location": "a",
"category": "a",
"breed": "a",
"weight": "a",
"damID": "a",
"sireID": "a",
"generalList": [
{
"genDate": "10-10",
"genComment": "comment1"
},
{
"genDate": "20-20",
"genComment": "comment2"
}
],
"performanceList": [
{
"perfDateGain": "10-10",
"perfWeight": "123",
"perfBCS": "123",
"perfChange": "123",
"perfRate": "123",
"perfDateBreed": "10-10",
"perfEval": "123",
"perfCommentBreed": "asd"
}
],
"healthList": [
{
"healthDate": "10-10",
"healthIssue": "asd",
"healthAction": "asd",
"healthDosage": "123",
"healthComment": "asd"
}
]
}
}
And here is the function code I’m using to update the DB:
Like I said, it has something to do with the way I am accessing the index of my array inside of my object, because everything works fine except for that part. Is there a special way to access array elements inside objects? Thanks!