Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AttributeError: 'dict' object has no attribute 'distinct'

I have a bson file, and i dont know what have inside of the file. So, a read the file. And now, i still trying to found the value of each key, but not is easy. Because, i receive the messange:

AttributeError: ‘dict’ object has no attribute ‘distinct’

What i do?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Am I writing more code? What am I doing wrong?

>Solution :

When I do understand your question, read_content['_id'] should suffice.

So the code should be:

read_content = bson.json_util.loads(content)
print(read_content['_id'])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading