These are chat archives for Automattic/mongoose

16th
Jun 2015
Valeri Karpov
@vkarpov15
Jun 16 2015 17:18
@eloytoro mongodb server doesn't really support a notion of foreign key constraints, so mongoose can't really do inter-collection validation in any sane way. For example, unique isn't actually mongoose validation, mongoose just creates a unique index on the mongodb server and the server enforces uniqueness
@EricMcRay you can also use custom validators and use something like https://www.npmjs.com/package/boom to attach HTTP status codes to returned errors
@nottinhill unit testing is pretty straightforward in JS, numerous tools like sinon and strawman to generate stubs, and writing your own stubs is trivial. Nowadays I find API level integration tests to be a better fit for the kind of dev work I do though http://thecodebarbarian.com/2015/03/13/testing-rest-apis-with-acquit
Erinç Fırtına
@EricMcRay
Jun 16 2015 17:27
@vkarpov15 i did not know Boom. Looks like its a very handy module. Thanks for that!