Machine Learning Pills

Machine Learning Pills

Extra

Extra #8 - Python Dictionaries vs. MongoDB Documents

David Andrés's avatar
David Andrés
Apr 08, 2026
∙ Paid

💎Extra Pill of the Week

Welcome back to the newsletter! In our last full edition, we explored how NoSQL databases like MongoDB handle data, and we even used Python to insert and retrieve records. If you paid close attention to the code, you might have noticed something interesting: the data we sent to MongoDB looked exactly like a standard Python dictionary.

Issue #126 - What is NoSQL?

Issue #126 - What is NoSQL?

David Andrés
·
Apr 5
Read full story

It is incredibly easy to blur the lines between the two, especially when you are using a library like PyMongo that seamlessly bridges the gap. However, assuming a Python dictionary and a MongoDB Document are exactly the same thing can lead to some tricky bugs down the road.

Today, we are popping the hood to look at the subtle but crucial differences between your Python dictionaries and MongoDB’s underlying document structure.

Keep reading with a 7-day free trial

Subscribe to Machine Learning Pills to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2026 MLPills · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture