И да, до этого все нормально работало
You can replace the `.save()` method with the `.updateMany()` method in MongoDB 5.2 by using the `upsert: true` option. The `upsert: true` option tells MongoDB to insert a new document if no documents match the filter, or update the matching documents.
Here is an example of how you can use the `.updateMany()` method with the upsert: true option to replace the .save() method:
db.collection.updateMany(
{ _id: document._id },
{ $set: document },
{ upsert: true }
)
`collection` is the name of the collection where you want to save the document.
`{ _id: document._id }` is the filter that matches the documents that you want to update or insert.
`{ $set: document }` is the update operation that sets the fields of the matched documents to the values of the document variable.
`{ upsert: true }` is the option that tells MongoDB to insert a new document if no documents match the filter.
With this method, MongoDB will check for the `_id` of the `document` and update the existing one if it exists or insert the new one if it does not exist. This way you can have the same behavior as the `save()` method but with better performance as it will only lock the document that is being updated, not the whole collection.
You can also use `.updateOne()` method if you know that you only want to update one document with a specific filter.
Keep in mind that the `updateMany()` method will update all the documents that match the filter and `updateOne()` will only update the first one it finds, so be careful when using the filter.
ид сабмит есть, класс сабмит есть, а типа сабмит нет