Nedb db.count()

2018-07-11 19:26 更新

db.count(query, callback)

作用:

計(jì)數(shù)。與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
});


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)