Filter syntax for endpoint

Hi, I’m looking for the correct syntax about filter in a endpoint/php call, in order for a specific filter item to accept several values.

Here I have a working piece of code that works to retrieve “events” for which “type” = ‘workshop’

$eventstocome = cockpit("collections")->find("events", ['filter' => ['published'=> true, 'ended'=> false, 'type' => 'workshop'],'limit'=> 100, 'sort'=>['startdate'=> 1] ]);

But I would like to retrieve “events” that match “type” either ‘workshop’ or ‘spectacle’ or ‘lecture’.
Is there any syntax with “OR” or something like “in_array” that would make it feasible ?

Thanks for your help.

$eventstocome = cockpit("collections")->find("events", [
    'filter' => [
        'published'=> true, 
        'ended'=> false, 
        '$or' => [
            ['type' => 'workshop'],
            ['type' => 'spectacle'],
            ['type' => 'lecture'],
        ]
    ],
    'limit'=> 100, 
    'sort'=>['startdate'=> 1] 
]);

OR

$eventstocome = cockpit("collections")->find("events", [
    'filter' => [
        'published'=> true, 
        'ended'=> false,
        'type' => ['$in' => ['workshop', 'spectacle', 'lecture']]
    ],
    'limit'=> 100, 
    'sort'=>['startdate'=> 1] 
]);

Many thanks Artur, it’s exactly what I was looking for !

I’ve seen these operators $or and $in in my searches but always related to json API, and I did not managed to get the exact syntax for php.

And thanks again for the quick answer.