In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces mongodb query table fields, string interception and update methods, the text is very detailed, has a certain reference value, interested friends must read!
The update() method is used to update existing documents. The syntax format is as follows:
db.collection.update( , , { upsert: , multi: , writeConcern: } )
Parameter Description:
query : update query conditions, similar to sql update query after where.
update : update object and some newer operators (such as $,$inc...) It can also be understood as sql update query after set.
upsert : Optional, this parameter means, if there is no update record, whether to insert objNew,true for insert, default is false, do not insert.
multi : Optional, mongodb default is false, only update the first record found, if this parameter is true, update all the records found according to the conditions.
writeConcern : Optional, the level at which the exception is thrown.
Example:
Picture replacement address, fuzzy query first, then replace
db.pfs_merchants.find({'logo_url': /10.2.121.170/}).forEach(function(user) { user.logo_url = user.logo_url.replace("10.2.121.170","10.128.3.80"); print(user.logo_url); db.pfs_merchants.update({"_id":user._ id},{$set:{"logo_url":user.logo_url}}); }) The above is "mongodb query table fields, what is the method of string interception and update" All the contents of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.