mongodb 查詢

某個字段是否存在:rem

db.collection.find({ 字段名:{ $exists: true } }).limit(1)       只查詢1條數據it

查詢表中包含字段file的數據,只顯示1條:io

db.collection.find({ file: { $exists: true } }).limit(1)file

刪除im

刪除全部包含該字段名的數據統計

db.collection.remove({ 字段名:{ $exists: true } })數據

統計查詢

統計數據中包含該字段名的總數db

db.collection.count({ 字段名:{ $exists: true } })co

相關文章
相關標籤/搜索