a document in parentCollection has a property "child_ids" which stores objectids from documents in childCollection
==Behavior==
for query-testing purpose i hardcoded the objectids in my query as follows:
{"_id": {$in: [{$oid: "687a69d478b4bc14f555f596"}, {$oid:"687a69d478b4bc14f555f597"}] } }
this works as expected.
But when i use instead the array of object-ids from the selectedRow-Property of the table-component as follows:
{"_id": {$in: {{ myTable.selectedRow.child_ids}} } }
I get:
"No result returned"
"Query ran and did not return any results."
In the attached screenhot the naming of the properties is a bit different:
table-component => listProcesses
child_ids == subprocess_ids
Not familiar at all with mongoDB, but this issue is similar also with postgres. I found the below conversation, which is the inverse of what you're trying to achieve.
Which makes me think that you may need to stringify the variable, e.g. {{ JSON.stringify( listProcesses.selectedRow.subprocess_ids ) }} ?
I tend to agree with @MiguelOrtiz - when you are accessing listProcesses.selectedRow.subprocess_ids you are getting an array of ids as strings. Compared to your hardcoded example which had an array of objects, each with a key of $oid, these aren't going to be read the same in MongoDB. In order to match the format of your hardcoded example, it makes sense to iterate over the array and map those ids into objects with a key of $oid.