Please tell me about how mongoose uses updateMany to update in batches.

Schema:

the update I want to implement is to store the same carId, for the stopName in the stops array. How should I implement such batch updates in mongoose? Common Update on the Internet is for a single field, did not encounter such a case, please friends can give a sample code, thank you!

I"m afraid people think it"s too roundabout. To put it simply, as defined by Schema, there is now an array that stores a lot of stopName,. I want to give them the same value of carid. How should I update them in batches with mongoose"s Update?


it turns out that I'm thinking too much, but it's not that complicated! [crying manually,]

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b304f5-2bd08.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b304f5-2bd08.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?