Skip to content

Instantly share code, notes, and snippets.

@QQBoxy
Last active May 17, 2016 07:12
Show Gist options
  • Save QQBoxy/0d4cb4ce1548086d58bc67fb5fb7c672 to your computer and use it in GitHub Desktop.
Save QQBoxy/0d4cb4ce1548086d58bc67fb5fb7c672 to your computer and use it in GitHub Desktop.
//假設有個資料表內有這些資料:
[{
name: "數學",
type: "教科書",
date: "2016/05/17"
},
{
name: "英語",
type: "教科書",
date: "2016/05/16"
},
{
name: "小叮噹",
type: "漫畫",
date: "2016/05/15"
},
{
name: "紅樓夢",
type: "小說",
date: "2016/05/14"
},
{
name: "烏龍派出所",
type: "漫畫",
date: "2016/05/12"
}]
//我想要顯示最新的兩種類的書,
//所以應該會取得數學、小叮噹,
//想請問單純用Mongodb的語法可以辦到嗎?
//如果可以那麼語法該如何下呢?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment