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--
In this popular season of mongodb, its api is still very rich. Let's take a look at api under python.
Address http://api.mongodb.com/python/current/tutorial.html
Installation, pip install pymongo
With regard to the configuration of mongodb, it has been installed and the specific steps are not given here
Pymongoc=pymongo.MongoClient (=, =) / create mongo connection db=c.get_database () / connect mongo library db.authenticate (,) / / mongo authentication. If your mongo does not have authentication enabled, this line can omit the h=db.get_collection () / / acquisition table similar to mysql. If there is no such table, then create mydict = {:,:} (h.find ({:}) []) / / to get a data object You can use a list-like way to take a value (h.find_one ({:})) / / get a qualified value I h.find ({:}): (I) the department makes a basic test. If you need something more complicated, you can check it out officially.
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.