Hi all.
In the docs, there's this
monger.collection/insert-and-return
is an alternative insertion function that returns the exact documented inserted, including the generated document id:
then this
It is highly recommended to always store documents with the :_id
key set. If you need a generated object id.
So, does insert-and-return address the object id generation concern above, or should I be generating and merging object ids when inserting with insert-and-return anyway?
Also, how do I check for write errors when using insert-and-return? Is it possible at all?
Thanks!
Henrique