Hello I’m new in MongoDB laravel and I have the following error:
This is the object I want to query in Mongo.
I want to fetch timestamps that are greater than or equal to 2022/7/5 and less than or equal to 2022/7/6, according to my logic in Laravel with the Jenssegers/laravel-mongodb, would have this:
$tracks = TrackFishing::where('boat_id', '3')
->whereBetween(
'tracking.timestamp', array(
Carbon::createFromDate(2022, 7, 5),
Carbon::createFromDate(2022, 7, 6)
))
->first();
I want to get position 0 of the timestamp but this throws me empty, I’d appreciate your help
3
Answers
I solved with a aggregate:
this question helped me
thank you all for replying
You need to specify the hour, minute and second
try with this one;