查询API

作者: 奉先 | 来源:发表于2021-11-08 19:17 被阅读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}  });

相关文章

网友评论

      本文标题:查询API

      本文链接:https://www.haomeiwen.com/subject/tzaezltx.html