Mongoose has not implemented a convenience wrapper for that just yet.
However, Model.collection provides read-only access to the underlying collection object from the native driver, including its methods.
Instead of Model.updateMany(), try using Model.collection.updateMany(), which should use the syntax described for the MongoDB Node.JS driver
Edit
Ugly demo code using Mongoose 5.12 and MongoDB 4.2:
const mongoose=require('mongoose');
const testSchema = new mongoose.Schema({ test:String });
const testModel = mongoose.model('testModel',testSchema);
mongoose.connect('mongodb://localhost/test', {useNewUrlParser: true, useUnifiedTopology: true});
async function main() {
const doc = new testModel({test:"testString"});
await doc.save();
const result = await testModel.collection.updateMany({},[{$set:{updated:{$concat:["$test",{$toString:"$_id"}]}}}]);
console.log("matchedCount:",result.matchedCount);
console.log("modifiedCount:",result.modifiedCount);
const newdoc = await testModel.findOne({});
console.log(newdoc);
process.exit();
}
main();
Output from the above:
matchedCount: 1
modifiedCount: 1
{
_id: 606945d4d5a5d9bec9038a59,
test: 'testString',
__v: 0,
updated: 'testString606945d4d5a5d9bec9038a59'
}