I have a an object 'Post' which can have many 'Comments'. I want to add these comment objects (pointers) to an array in Post.
Currently I have added them in the following way using 'PUT':
{
"comments": {
"__op": "AddUnique",
"objects": {
"__type": "Pointer",
"className": "Comment",
"objectId": comment.commentId
}
}
};
When I look in the object browser at the column defined as 'Array' in the 'Post' object I see it represented in the following way:
[
{
"$each": {
"__type": "Pointer",
"className": "Comment",
"objectId": "FuH4dAgSfJ"
}
},
{
"$each": {
"__type": "Pointer",
"className": "Comment",
"objectId": "ogxH4RjcJQ"
}
},
{
"$each": {
"__type": "Pointer",
"className": "Comment",
"objectId": "bPECgp3o9D"
}
}
]
What am I doing wrong here?