3 ms·
I don't understand why he talks about an ORM (object-relational mapper).
by middus 15y ago
I don't understand why he talks about an ORM (object-relational mapper).
- ndaugherty18 15y agoI was thinking the same thing. Why do you have to have an ORM to make Mongo great?
- gregwebs 15y agoI added a more detailed explanation, I hope it makes sense: In a database with a schema, if you saved a string to an integer field, the database could either complain or coerce the string to a integer. Either way, whenever you read a row, you know what type the value will be whenever you read data a row from the database. Another issue with schemaless is simply mis-typing the key (column) name. If you have a field called referrer, but you perform a query using referer, MongoDB won’t know you have done anything wrong. In a SQL database you will get an error on insert and on querying. An ORM can instead be the one to tell you about the error.
- middus 15y agoAn object-relational mapper maps between objects and relations -- hence the name. Thus, without relations (-> Mongo) there can be no ORM.
- gregwebs 15y agoPerhaps I am using the term to loosely, and I do see people use an acronym with a D for document now. There are still plenty of relations in Mongo, particularly when you expose them through Mongoid, rather than being enforced in a schema: http://mongoid.org/docs/relations.html http://mongoid.org/docs/relations.html The MongoDB docs do say that I am supposed to use the term "ODM". I will update my post. thanks.