你会如何写这样的查询
db.collection.find({$expr: {$lte: [{ $mod: [ '$created_at', 3600 ] }, 59]}});
使用jenssegers / laravel-mongodb扩展
答案 0 :(得分:1)
使用原始表达式following the documentation
YourModel::whereRaw([
'$expr' => [
'$lte' => [
[
'$mod' => [
'$created_at', 3600
],
59
]
]
]
])->get();