Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

read MongoDB create criteria input

BautastenBautasten Member Posts: 7 Learner III
edited January 2020 in Help
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

Answers

  • kaymankayman Member Posts: 662 Unicorn
    edited January 2020
    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 need
Sign In or Register to comment.