表结构如下:
{
_id: 123,
title: '《鲁迅自传》'
comment: [
{
_id: 1,
content: '哈哈哈',
like: 10
},
{
_id: 2,
content: '好看',
like: 3
},
{
_id: 1,
content: '嘿嘿嘿',
like: 8
}
]
}
现在想查询这张表数据并输出 条件:输出的comment字段是按like数由大到小排序的
请问查询语句怎么写
表结构如下:
{
_id: 123,
title: '《鲁迅自传》'
comment: [
{
_id: 1,
content: '哈哈哈',
like: 10
},
{
_id: 2,
content: '好看',
like: 3
},
{
_id: 1,
content: '嘿嘿嘿',
like: 8
}
]
}
现在想查询这张表数据并输出 条件:输出的comment字段是按like数由大到小排序的
请问查询语句怎么写
2 回答745 阅读✓ 已解决
1 回答845 阅读✓ 已解决
1 回答798 阅读✓ 已解决
1 回答569 阅读✓ 已解决
2 回答892 阅读
1 回答1k 阅读
1 回答815 阅读
单靠一条mongo语句我看是没戏