Filter option "$where"

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';
1 Like

There is nothing more for me to add here. Just needed a reply to mark this “solved”.