auto-crud icon indicating copy to clipboard operation
auto-crud copied to clipboard

Error on retrieving the id after POST

Open demarchisd opened this issue 8 years ago • 0 comments

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?

demarchisd avatar Sep 13 '16 11:09 demarchisd