Closed carlosperez closed 7 years ago
Cool, thanks for this. I know nothing about Mongoose though. Are you able to just point me in the right direction for what Mongoose does with ops
and why? I'll have a quick read and merge once I'm happy with this change. Cheers.
Hi @chilts – thanks for the quick response. Unfortunately, I'm not sure what Mongoose does with ops (or why). I searched the Mongoose repo for ops and there are some results that might help explain? https://github.com/Automattic/mongoose/search?utf8=%E2%9C%93&q=ops
When using Mongoose, we're finding that the results array item that contains
_id
is actually nested under theops
parameter. This patch checks forresults.ops[0]
first, otherwise defaulting to results[0].