当前位置:Gxlcms > 数据库问题 > mongodb 降序

mongodb 降序

时间:2021-07-01 10:21:17 帮助过:5人阅读

title":1,_id:0}).sort({"title":-1})// 1用于升序排列,而-1用于降序。

示例代码:

    var user = await Kitten.find({
        types: "散文随笔",
        _id: ctx.query.id
    }).sort({
        "createAt": -1
    }).exec();
    var comment = await Comment.find({
        Postedid: ctx.query.id
    })

 

mongodb 降序

标签:exec   com   await   ted   gpo   mongod   use   nbsp   div   

人气教程排行