Query all objects by array of Ids

I would like to run a query, where i know the object ids of the objects to return.

I see there is a ContainsAll() query function, but i would need a ContainsAny() function to perform this query.

Is this possible or is there a workaround?

My array would have around 25-100 values.

export const getUsers = async (ids: string[]) => {
  const userQuery = new Parse.Query(Parse.User);
  userQuery.containedIn('objectId', ids);

  const data = await userQuery.find({ useMasterKey: true });

  const map = data.reduce((acc, item) => ({
      ...acc,
      [item.id]: item,
  }), {} as { [id: string]: Parse.User });

  return map;
};

Thank you for this, missed the ContainedIn option, works great.

However i have 1 more issue, i would like the results to be returned in the same order as what the ids were passed. Is this possible?

If not then i think i may need to do some array manipulation after the results have been returned.

I don’t know if it is possible to get the result in the same order as what the ids were passed, I would expect it to not be in the same order