MongoDB:按列表排序

时间:2014-11-06 17:12:04

标签: mongodb sorting

我有活动会员名单

[
  {"user":"id1", "event":"..."},
  {"user":"id2", "event":"..."},
  {"user":"id3", "event":"..."}
]

和朋友的id列表

["id2","id3"]

如何按朋友ID列表对所有活动成员进行排序?

[
  {"user":"id2", "event":"..."},
  {"user":"id3", "event":"..."},
  {"user":"id1", "event":"..."}
]

PS:我需要保留函数$ skip和$ limit

0 个答案:

没有答案