Python Operation MongoDB

Source: Internet
Author: User
Tags mongodb redis

MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.

MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data exists on the hard disk, Redis is in memory, and Redis wants to be persisted to the hard drive.

First use PIP install Pymongo and then use import Pymongo

Here is an example of the operation

ImportPymongom=pymongo. Mongoclient (host="', port=1111) DB=m["ssss"]collection=db['SSS']collection.insert ("')#Inserting DataCollection.find ()#Find DataCollection.delete_many ()#Delete Multiple stripsCollection.delete_one ("')#Delete a barCollection.update ()#Update DataCollection.update_many ()#update more than one dataCollection.update_one ()#update One piece of data

Python Operation MongoDB

Related Article

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.