Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
Cannot perform a non-multi update on a time-series collection

Hi I am using newly Timeseries mongodb collection. My mongodb version is 5.0.6. I am following this tutorial. I create a collection like this.

   db.createCollection("ticker", {
     timeseries: {
        timeField: "time",
        metaField: "metadata",
    },
});

I inserted the sample document like this.

db.ticker.insertOne({
 time: ISODate("20210101T01:00:00"),
 symbol: "BTC-USD",
 price: 34114.1145,
 metadata: { a: ""}
});

When I am trying to update metadata field it gives above error. As mentioned here is limitation you can only update metaField but still it is giving above error. Here is the update code

db.ticker.update({ "metadata.a": "a" }, { $set: { "metadata.d": "a" } })

write failed with error: {
    "nMatched" : 0,
    "nUpserted" : 0,
    "nModified" : 0,
    "writeError" : {
        "code" : 72,
        "errmsg" : "Cannot perform a non-multi update on a time-series collection"
    }
}

Need help what I am doing wrong.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try adding { multi: true } config.

If you check the docs, there are still some limitations for updating time-series collections.

Update commands must meet the following requirements:

  • The query may only match on metaField field values.
  • The update command may only modify the metaField field value.
  • The update must be performed with an update document that contains only update operator expressions.
  • The update command may not limit the number of documents to be updated. You must use an update command with multi: true or the updateMany() method.
  • The update command may not set upsert: true.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!