擅长:python、mysql、java
<p>确保您的数据库是mongodb中的数据库。如果您的数据库是mongodb的<code>client.db</code>,那么您的代码是正确的</p>
<pre><code>MONGODB_URI = "mongodb://user:password@host:port/"
client= pymongo.MongoClient(MONGODB_URI)
# database
db = client.db
# db.collection.find({}) will get the item list
result = db.inv.find({})
</code></pre>