title: Can I fetch last inserted subdocument in Mongoose using pop()?
body: <p>I am doing a <code>findOneAndUpdate</code> call to add to a subdocument array using <code>$addToSet</code>. The operation returns the newly updated document. I would like to extract the subdocument that just got inserted. Is it safe to use <code>pop()</code> in this case? I know that browsers vary in how arrays/objects are ordered but not sure about the node/mongo case.</p>