📜  mongoose $in 运算符顺序不被尊重 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:42.448000             🧑  作者: Mango

代码示例1
//just reorder the resulting array like so
docs.sort((a, b) => ids.findIndex(id => a._id.equals(id)) - 
                    ids.findIndex(id => b._id.equals(id)));