我正在使用jenssegers与Laravel合作开发mongoDB。我想要得到 基于layout.price的排序文件。
这是否可能在带有laravel的mongodb中。 ?
我正在使用限制和跳过分页,所以我必须从数据库获取orderBy或直接排序。
[{ "title": "I am first document", "design": "mango", "description": "Loremipsum", "dimension": [ { "id": "542549383d1784901000002c" } ], "layout": [ { "id": "542411813d17849810000029", "price": NumberInt(69000) }, { "id": "542411813d17849810000030", "price": NumberInt(2000) } ], "images": [ "uploads/sofa/QRSTU695a6_0.png" ], "product_type": NumberInt(1), "updated_at": ISODate("2014-10-08T08:47:26.0Z"), "created_at": ISODate("2014-09-29T11:13:52.0Z") }, { "title": "I am second document", "design": "mango2", "description": "Loremipsum", "dimension": [ { "id": "542549383d1784901000002d" } ], "layout": [ { "id": "542411813d17849810000031", "price": NumberInt(80000) }, { "id": "542411813d17849810000032", "price": NumberInt(27000) } ], "images": [ "uploads/sofa/QRSTU695a6_0.png" ], "product_type": NumberInt(1), "updated_at": ISODate("2014-10-08T08:47:26.0Z"), "created_at": ISODate("2014-09-29T11:13:52.0Z") }]