1. simple example
import pymongo from pymongo import MongoClient con=MongoClient(‘localhost‘,27017) db=con.db# database name "db" names=db.users # collection name "users" item=names.find_one() print item[‘name‘]
时间: 2024-10-13 10:32:39
1. simple example
import pymongo from pymongo import MongoClient con=MongoClient(‘localhost‘,27017) db=con.db# database name "db" names=db.users # collection name "users" item=names.find_one() print item[‘name‘]