How do I query mongodb with an array of strings that should be objects

I'm trying to get a list of members. In mongodb the array is a list of ObjectIds. But when I run the query it finds nothing. I know the actual ID's are valid. There could be a few deleted users, but most of them exist.
On our server we are building the query with Mongoose and it works fine, but I'm not sure how to do that here. It looks like my options are to convert the strings to objects in the users query, or the original data as a post-query transformer on the data source. I've made a few attempts, but I'm not sure if I'm even on the right track.
Screen Shot 2022-03-06 at 2.22.21 PM

This query works, but that's for a single user and I can specify it should be treated as an $oid.
Screen Shot 2022-03-06 at 2.34.07 PM

Hi, mrtwebdesign :wave:

Happy to help. What you would like is to have is an array of objects where each object has they key "$oid" and the value is each string from the array. Currently there's an array of strings. Here's an example of what that would that would look like:

{ "_id" : { "$in" : [ { "$oid" : "5f64b47aac01030026e46fa5"} , { "$oid" : "5f67afea4cebe4001ac964cc"}, { "$oid" : "5f64c3134cebe4001ac964bd"}]}}

Let me know if that helps or if you need anything else in the meantime

I'm back because I still need to solve the same problem. Not having an interface like this set up is costing me a lot of time, but I still can't figure it out.
The example query might work, but I can't build it like that. I have to reference an array returned by another query. I don't have a static list of member id's, I have an array returned by another query.
if is an array of strings that need to be transformed into objectIds is there a way to do that in the query?
I tried writing a transformer in the source of the data, but it didn't work. The error returned by retool was "Could not evaluate transformer in Bailiwiks: Error: Object.key is not a function".
I would normally do something like:

let objectIdArray = => mongoose.Types.ObjectId(s));

But I would need access to mongoose for that.

Hey mrtwebdesign! Sounds like you're looking for a solution like the above, just more dynamic so that we can return data given IDs returned by another MongoDB query?

I was able to put something like that together by constructing the array of objects in the source query's transformer, and then just referencing that in the outer query. I used a dummy source query to return hard-coded IDs for the example, but that could be anything on your side that's returning them.