I just wanted to drop this here for others to find … and future me.
This is the new $where
filter option, introduced in 33e7199 and that’s the official example on how to use it
cockpit('collections')->find('posts', [
'filter' => [
'$where' => function($doc) {
return $doc['published'] && $doc['title'] != 'Lorem Ipsum';
}
]
]);