Can somebody tell me please what is the best practice to query Mongodb date object via PHP? Mongo driver has a lot of strange classes like MongoDB\BSON\Undefined or MongoDB\BSON\UTCDateTime... Now I want to send query to Mongodb which could look like
$collection->find(['publishDate' => new DateTime()])
Its simple and clear. My question is - Is is possible to od it this way or I need to write something like
$collection->find(['publishDate' => new MongoDB\BSON\UTCDateTime( microtime() )])
What is the best practice? Thanks.