Saturday 13 February 2016

REST API: using native mongo driver, how do you validate data? Also do you separate routes completely?

1) I'm using native mongodb driver as i was told it's more efficient than mongoose. with that said, do you usually validate all expected data in the request? I'd assume so. how thorough are you with it? any examples?2) we have this weird setup where we have one generic route where you provide the collection name in the request and the CRUD action is applied there. Is this.. ok? Do you usually separate routes out for different collections and have some logic reproduced? I imagine it makes sense to separate out my routes more since for example: deletes for one may have further requirements than a deletes for another.

Submitted February 14, 2016 at 12:28AM by -proof

No comments:

Post a Comment