I would like to add an object to an array if an object with the same does not already exist in the array. For e.g., my object is {
"id": userID,
"userName": userResult.toPublicProfile.Name,
"image": userResult.toPublicProfile.Image,
"badge": ""
}
I can construct the individual queries like below, but is it possible to join the two queries below in a single query. I was unable to find anything in the documentation regarding that.
"body": {
"where": {
"attendeeList": {
"$elemMatch": {
"id": userID
}
}
}
}
"body": {
"attendeeList": {
"__op": "AddUnique",
"objects": [{
"id": userID,
"userName": userResult.toPublicProfile.Name,
"image": userResult.toPublicProfile.Image,
"badge": ""
}]
}
}