查询API
2021-11-08 本文已影响0人
奉先
1. 修改文档字段信息 :
下边的例子修改doc_id = 2 的文档的两个字段
2. 查询文档的某些字段:
下边查询 doc_id = 2 的文档的 2个字段shareholder和shareholder_entpub :
db.getCollection('company_mirror_pre').find({"_id":2},{"shareholder" : 1, "shareholder_entpub": 1});
// _id 小于10000,并且存在basic字段
db.getCollection('company_mirror_pre').find({"_id" : {$lt : 10000} ,"basic":{"$exists":false} });