M
M
Malik2021-05-24 11:04:23
MongoDB
Malik, 2021-05-24 11:04:23

How to update the entire database using updateMany?

I need all incoming data for all fields, update in the mongo database, that's what I found but it doesn't work, tell me how to use it correctly

async filterDatabase(filterClient){
        const data = await this.productModel.updateMany(
          {},
          {filterClient},
          { multi: true}
        );
        return data
     }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question