1. 选择题(多选)
假设现在要对test数据库的users集合进行操作,在查询一个文档时,以下代码正确的是?
A.
client = MongoClient()
db = client.test
user_obj = db.users.find_one()
B.
client = MongoClient()
user_obj = client.test.users.find_one()
C.
client = MongoClient()
db = client['test']
users= db['users']
user_obj = users.find_one()
D.
client = MongoClient()
db = client.get_database('test')
users = db.get_collection('users')
user_obj = users.find_one()