📅  最后修改于: 2022-03-11 15:02:42.448000             🧑  作者: Mango
//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)));