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

186
Views
How does Builders<TA>.Update.Set() handle parallel access?

Assuming 'items' (provided as a parameter in the Set() method below) is defined as List (TM is some structure type, i.e. made of properties only) containing only one item, and 10 processes trying to write simultaneously an update to items (without adding anything to the List):

Builders<TK>.Update.Set("Items", items);

An update means that there is at least one element in the BSON with a modified value.

What will MongoDB in such case?

Will it eventually overwrite with the last process into that single element (leaving that List with a single element)?

Or will it add 10 such elements (items) into that List?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I don't know how doesit work with parallel access. But Set operator always overwrite value with an inserted.

To add new values to an array you should use addToSet operator (it adds only new values) or push operator.

You could access them as Builders too:

Builders<TA>.Update.AddToSet
Builders<TA>.Update.Push
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!