简体   繁体   中英

module 'gridfs' has no attribute 'get' I am getting this error in python

item = db.WineImages.find_one({'id': id})

 image = grid_fs.get(item['id'])

base64_data = codecs.encode(image.read(), 'base64')

image = base64_data.decode('utf-8')

You might wanna use object id in GridFs. fs.get_last_version('_id': (your variable for object id))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM