Nedb db.count()

2018-07-11 19:26 更新

db.count(query, callback)

作用:

计数。与find用法相同。

示例:


// Count all planets in the solar system
db.count({ system: 'solar' }, function (err, count) {
  // count equals to 3
});
 
// Count all documents in the datastore
db.count({}, function (err, count) {
  // count equals to 4
});


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号