Pass in array as a parameter to N1QL query

Hi there,

I was wondering if it’s possible to pass an array of objects as a parameter and have a query run while looping over each element?

Here’s a made up example of what I’m looking for:
User bucket

userA: { email: userA@userA.com, displayName: Rusty }
userB: { email: userB@userB.com, displayName: Shackleford }

Cars bucket

car1: { ownerId: userA, colour: green }
car2: { ownerId: userB, colour: blue }
car3: { ownerId: userA, colour: black }

I have an array. Each element in the array is a pair consisting of a user id and car id. What I want do to is perform a query that will return the user.displayName and colour of the corresponding car that they own. So if the array is:

[ { userA, car3 }, {userB, car2} ]

I want to return:

[ { displayName: Rusty, colour: black }, { displayName: Shackleford, colour: blue } ]

Right now I split up the array and send a separate query for each element. Is there way I can pass the whole array in a N1QL query and have it loop over each element before returning all of the results?

Thanks so much for all the help you guys provide to the community!!

INSERT into default VALUES("userA", {"email": "userA@userA.com", "displayName": "Rusty"});
INSERT into default VALUES("userB", {"email": "userB@userB.com", "displayName": "Shackleford"});
INSERT into default VALUES("car1", {"ownerId": "userA", "colour": "green"});
INSERT into default VALUES("car2", {"ownerId": "userB", "colour": "blue"});
INSERT into default VALUES("car3", {"ownerId": "userA", "colour": "black"});

SELECT raw {"displayName": u.displayName, "colour": c.colour}
FROM [{"userId": "userA", "carId": "car3"}, {"userId": "userB", "carId": "car2"}] as arr
    JOIN default u ON arr.userId = meta(u).id
    JOIN default c ON arr.carId = meta(c).id;