2021-12-13 16:04:10 +08:00
|
|
|
import pymongo
|
|
|
|
|
|
|
|
client = pymongo.MongoClient('mongodb://{}:{}@{}:{}'.format('root', 'sromitdTW569kC#M', '116.63.130.34', 27018))
|
|
|
|
|
|
|
|
|
2021-12-21 11:06:58 +08:00
|
|
|
def find_data_in_company(param1, param2):
|
2021-12-13 16:04:10 +08:00
|
|
|
"""
|
2021-12-21 11:06:58 +08:00
|
|
|
从企业数据库中查询数据
|
2021-12-13 16:04:10 +08:00
|
|
|
Parameters:
|
2021-12-21 11:06:58 +08:00
|
|
|
param1 str 数据表
|
|
|
|
param2 dict 查询条件
|
2021-12-13 16:04:10 +08:00
|
|
|
Returns:
|
|
|
|
res: desc
|
|
|
|
"""
|
2021-12-21 11:06:58 +08:00
|
|
|
collection = client['企业'][param1]
|
|
|
|
data = collection.find(param2, {'_id': False})
|
2021-12-17 17:15:20 +08:00
|
|
|
record = list(data)
|
|
|
|
return record
|