在更新Mongo Collection时如何将收集和DB作为参数保持?

发布于 2025-01-24 08:13:18 字数 103 浏览 0 评论 0原文

如何将DB和集合作为UpdateMany中的参数?

db.collection.updateMany()

我正在使用python

How to make db and collection as parameter in updateMany?

db.collection.updateMany()

I am using python

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

或十年 2025-01-31 08:13:18

在使用驱动程序设置连接时,您需要执行此操作,

client = MongoClient('mongodb://localhost:27017/') //this is the url of account
db = client.test_database //setting the db
collection = db.test_collection //setting the collection

You need to do that while setting up the connection using the driver,

client = MongoClient('mongodb://localhost:27017/') //this is the url of account
db = client.test_database //setting the db
collection = db.test_collection //setting the collection
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文