I am making an insert with native mongodb for nodejs and in some cases, using insert returns me an array with the object I inserted, but sometimes it does not. I don't understand why it is inconsistent like this, I only want the object i inserted (which now includes _id) without the array wrapper, or, always return it WITH that wrapper.
Why does it do this?
The only time the second parameter to your callback won't be an array of the inserted documents is when the first parameter is non-null to indicate an error occurred. See docs.