read MongoDB create criteria input
Bautasten
New Altair Community Member
Hi,
I have data that is pulled form a different data source and now I need to use the id from that data in MongoDB criteria to filter the result, I can't figure out how to do that.
Any ideas?
BR,
Patrik
I have data that is pulled form a different data source and now I need to use the id from that data in MongoDB criteria to filter the result, I can't figure out how to do that.
Any ideas?
BR,
Patrik
Tagged:
1
Answers
-
Hi @Bautasten, One possible solution is the following :
- Get the attribute you need (the ID of your source table)
- If the attribute is a nominal quote it using the replace functions so myID1 becomes "myID1". If it is numeric you can skip this step.
- Next use the aggregate operator and concatenate your field, now you get something like "myid1"|"myid2"|"myid3" and so on
- Replace the pipe (|) with a comma so you get "myid1","myid2", "myid3"
- store your field as a macro and call it for instance ids
Finally call Mongo like {_id:{$in:[%{ids}]} but with using the fields you need2