Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Mongoose is a client-side library. It emulates relations and schemas client-side, as I also pointed out in the article.This also means that the database cannot optimize for relations and schemas, as it doesn't even know they exist.

Mongoose is also very much not the default MongoDB client in Node.js - it's a third-party client library by Automattic. The official client according to the MongoDB documentation is `mongodb` (https://www.npmjs.com/package/mongodb), which does not feature relations.



I have used and am aware of node-mongodb-native (I wrote http://stackoverflow.com/questions/19546561/node-mongodb-err... where we discovered it wrapped and threw away all exceptions in callbacks in the stable production version ), but Mongo (the company) have recommended Mongoose. The language now is vaguer than it was 'you can use it natively if you want, or use Mongoose' http://docs.mongodb.org/ecosystem/drivers/node-js/

Thanks for your excellent explanation and totally understood re: not being able to optimise for relationships on the server.


I actually didn't even notice Mongoose being mentioned on that page, to be honest, given that the instructions were for `mongodb`. I'd imagine that neither would a developer skimming the page :)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: