【发布时间】:2018-10-30 16:16:41
【问题描述】:
persons收藏:
{
name: "jhon",
msgs: {
chat_one: [
{id: 1234, msg: "hi", date: "18/05/2018"},
{id: 1234, msg: "hello", date: "19/05/2018"}
],
chat_two: [
{id: 1234, msg: "hi", date: "18/05/2018"},
{id: 1234, msg: "hello", date: "19/05/2018"}
]
}
}
如何使用猫鼬查询并获取如下数据。
- 按日期排序。
- 并返回一个人的
chat_one消息。
{ chat_one: [ {id: 1234, msg: "hello", date: "19/05/2018"}, {id: 1234, msg: "hi", date: "18/05/2018"} ] }
【问题讨论】:
-
日期存储为字符串?
-
不是日期对象