MongoDB
使用MongoDB
Mongo資料庫 > collection > document
SQL資料庫 > 資料表 > 資料列https://mlab.com/home如何測試剛創好的資料庫?
如何用Node.js連線到mLab?
開始操作資料庫
移除document
新增document
運用operator
$gt代表大於
$lt代表小於
$gte大於等於
$lte小於等於
使用type操作
使用limit()
使用skip()
使用sort()
比較這兩個Find()
如果是下載到local端啟用
Node.js 連接
Mongo有新增的連接方法,參考下面文章
使用Mongoose
使用Promise
注意:記得res.end回傳資料要先JSON.stringify
JSON.stringify查詢資料
其他查找方法和原生相似
我們也可先定義Schema在把他compile到model內
Last updated