MongonDB 連接包,MongooseJS 4.1.4 發布
Mongoose 是基于nodejs,使用javascript編程,連接mongodb數據庫的軟件包,使mongodb的文檔數據模型變的優雅起來,方便對mongodb文檔型數據庫的連接和增刪改查等常規數據操作。
var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/test'); var Cat = mongoose.model('Cat', { name: String }); var kitty = new Cat({ name: 'Zildjian' }); kitty.save(function (err) { if (err) // ... console.log('meow'); });
MongooseJS 4.1.4 發布,此版本主要是 bug 修復,更新內容如下:
-
fixed; ability to set strict: false for update #3305
-
fixed; .create() properly uses ES6 promises #3297
-
fixed; pre hooks on nested subdocs #3291 #3284 aliatsis
-
docs; remove unclear text in .remove() docs #3282
-
fixed; pre hooks called twice for 3rd-level nested doc #3281
-
fixed; nested transforms #3279
-
upgraded; mquery -> 1.6.3 #3278 #3272
-
fixed; don't swallow callback errors by default #3273 #3222
-
fixed; properly get nested paths from nested schemas #3265
-
fixed; remove() with id undefined deleting all docs #3260 thanpolas
-
fixed; handling for non-numeric projections #3256
-
fixed; findById with id undefined returning first doc #3255
-
fixed; use retainKeyOrder for update #3215
-
added; passRawResult option to findOneAndUpdate for backwards compat #3173
下載:https://github.com/Automattic/mongoose/archive/4.1.4.zip。