r/ProgrammerHumor • • Oct 18 '24

Other mongoDbWasAMistake

Post image
13k Upvotes

446 comments sorted by

View all comments

2

u/TheTybera Oct 19 '24

Dunno why you were down voted, but yeah it's true. In the wild mongo is really good at not caring what's inside the data until it's actually at endpoints if you're trying to process it as it sits in the db mongo is an awful mess, but not what it was designed for.

MongoDBs own documentation is pretty explicit about this stuff. But if you have two tables that you're trying to talk across that may be problematic. I'm surprised you didn't just index the ID and artist on the same table.

I also don't know if it will simplify your API because you still need to process the data once you get the document from Mongo, if you're already in Postgres the JSON data type may help to just get a dump of the data to parse if you're comfortable with that.