I'm using mongoose version 5.2.13, the latest I suppose. But when I try executing the .findOneAndUpdate() query, Mongo throws a deprecation warning:
DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.
Is this known behavior that should be fixed in future versions of mongoose? Or should I do something about it? The query I'm running is:
output2 = await dbUser.findOneAndUpdate(
{ _id: args.authorid },
{ $push: { posts: newpost2 } },
);
I'm not very comfortable downgrading my packages in case that's a possible suggestion as offered in MongoDB mongoose collection.find options Deprecation Warning.