Mongo batch update operations

Source: Internet
Author: User
Tags mongodb update
Mongo batch update operations use the mongodb update method to update multiple records www.2cto. comJava code db. logPreInfo. update ({uniqueKey :{$ in: [average, minimum, 1353314962526-855

Mongo batch update operations use mongodb's update method to update multiple records www.2cto.com Java code db. logPreInfo. update ({uniqueKey :{$ in: [average, minimum, 1353314962526-855


Mongo batch update operations

Update multiple records using the mongodb update Method

Www.2cto.com

Java code

Db. logPreInfo. update ({"uniqueKey": {"$ in": ["success", "1353314942260-fa87ed9c-5c28-49a8-8c2b-93e99dd8cccd", "success", "success"] }},{ "$ set ": {"endFlag": "0" }}, false, true );

The preceding statement can update Multiple matching data entries Based on the uniqueKey array.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.