我有一个使用XML数据Feed的应用。在此XML数据中,有一个dateacquired属性。
集合中的条目如下所示:
{
"_id": "22uYws2ki9qqALSwA",
"lat": "",
"lng": "",
"title": "FT Content Writer (MUST have exp in Marketo)",
"url": "http://my.jobs/bfb2464b0c1246698eb4b8f251f50658321",
"company": "Robert Half The Creative Group",
"address": "Norcross, GA",
"dateacquired": "2014-3-10 10:07 AM",
"onet": null,
"jvid": "bfb2464b0c1246698eb4b8f251f50658321"
}
我正在推送像Jobs.find({})
如何按dateacquired属性排序?
答案 0 :(得分:3)
您可以将certain query modifiers作为第二个参数传递给find
。 sort
就是其中之一:
Jobs.find({}, { sort: { dateacquired: 1 } });