Filtering by date using PHP

First, thank you for this great CMS and community. I’m still learning (and hope to migrate to Vue.js soon), but in the meantime am building a website with PHP. I’m having difficulty pulling collection entries with a filter by Date field.

My collection entry:

  "Published": true,
  "EventDate": "2020-09-22",
  "EventTime": "18:30",
  "CutoffDate": "",
  "MaxParticipants": 16,
  "SoldOut": false,
  "SoldOutCTA": "Oh no! You missed this one!",
  "SoldOutButton": "Stay informed",
  "SoldOutURL": "",
  "Cost": 150,
  "_mby": "5f0ca0713031353dd70002da",
  "_by": "5f0ca0713031353dd70002da",
  "_modified": 1598387449,
  "_created": 1598385648,
  "_id": "5f456df066613283e70001a8",
  "EventName": "Tell Yo Story!",
  "Image": {
    "path": "/admin/storage/uploads/2020/08/25/5f456ef544cadrecite-14382-608111113-1l6s9n3.png"
  "Slug": "",
  "Description": "<p>Aye spyglass rope's end bounty Jolly Roger keel Sea Legs bucko. Pieces of Eight Letter of Marque lugsail Sink me six pounders spyglass Sea Legs bounty. Fire ship tackle Shiver me timbers careen marooned cog mutiny lee.&nbsp;</p>"

My request from Cockpit:

$today = new DateTime();
$today = $today->format('Y-m-d');

$events = cockpit('collections')->find('Events', [
     'filter'    => [
         'Published'     => true,
         'EventDate'     => [$gte => $today]
     'sort'      => ['EventDate' =>  1],
     'limit'     => 3

It returns no records.

Thank you in advance!


You missed a quote. [$gte => $today] must be ['$gte' => $today].