Update to all collection records in Mongodb

Asked

Viewed 36 times

0

I have created a new field in my collection, but I would like to include this new field in all my collection records.

I tried to use the script that way:

db.getCollection('Contratos').update(
  {},
  {$set: {'pendente': false} },
  false,
  true
)

But returns me the following error by containing many records in the collection.

Request rate is large. More Request Units may be needed, so no changes Were made. Please Retry this request later.

Is there any way around this situation without running the same update more than once?

  • He even tried using updateMany? those false and true is the same as {upsert: false, multi: true}?

  • I just tried the updateMany and returned the same error. About the parameters, yes.. It is the upsert: false and multi: true.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.