我有这个对象,我想按它created_at对Demo2进行排序。 我使用mongodb作为db laravel php
Demo": {
"Demo2": [
{
"type": "review",
"created_at": "1970-01-01 05:30:00"
},
{
"type": "store",
"created_at": "2019-04-16 6:22:30"
},
{
"type": "postw",
"created_at": "2019-04-16 16:23:10"
}
],
}
如何通过laravel mongodb查询实现此功能。
答案 0 :(得分:0)
您需要使用Aggregation Framework来完成此操作
<button type="submit" name="processCarrier" class="button btn btn-default standard-checkout button-medium" style=""> <span> Proceed to checkout <i class="icon-chevron-right right"></i> </span> </button>