auto-crud
auto-crud copied to clipboard
Error on retrieving the id after POST
Hey!
I'm using mongodb driver version 2.2.9, and I was getting an error after any POST request.
The document was being persisted at the database. However, after that, an error was thrown because it was trying to get the '_id' property of 'undefined' (document[0]._id).
I forked your project and fixed it by accessing the 'ops' property before getting the document itself: https://github.com/demarchisd/auto-crud/blob/master/lib/autocrud.js#L142
Maybe it's a mongodb driver version incompatibility?