MongoDB Insert method, Update method, save method Simple Contrast 1.update methodThis method is used to update the data, the data in the document is updated, the change is updated, unchanged.2.insert methodThis method is used to insert data into the
View all databasesShow DBSSwitch Database (automatically created if not present)Use DatabaseNameDelete current DatabaseDb.dropdatabase ()There are no tables in MongoDB, only collections.Insert CollectionDb. Collection name. Insert (JSON)For example
1. Display Database list: Show DBS2. Apply a database: Use Dabasea (Dabasea is the database name, if the database does not exist, it will be created)3. Delete the current database: Db.dropdatabase ()--When the use Dabasea command is executed, the
1. Simple manual correlationFirst, the results are queried and put into a variable, and then queryu = Db.user.findOne ({author: "Wangwenlong"});For (var p = db.postings.find ({author:u.author});p. Hasnext;) {Printjson (P.next (). title); }2, Dbref
Today formally began to learn MongoDB.In the Debian system, the MongoDB server is installed via Apt-get install Mongodb-server.After installation, you can use the MONGO command to log on to the local server, which does not require validation, using
1. Some explanations
Less than: than. Less LT
Greater than: than. Multi-GT
equals: Equal E
the conditional operators in MongoDB are:
(>) Greater than-$GT
(
(>=) greater than or equal to-$gte
(
MongoDB (
The default database in MongoDB is test, and after connecting try the following actionsConnectionInsert data:Db.person.insert ({"name":"Jack"," Age ":")Db.person.insert ({"name":"Mary"," Age ":")Check:Db.person.find ()Db.person.find ({"name":"Jack"})
Official website: www.mongodb.org1. Download:Download the 32-bit or 64-bit. msi file according to the system, double-click the file after downloading, and follow the prompts to install it.2. Set the installation directory:Set up your installation
First, the index base:MongoDB's index is almost identical to the traditional relational database, which includes some basic optimization techniques. Here is the command to create the index:> Db.test.ensureIndex ({"username": 1})You can see whether
Back to Blog listOriginal YII2 Operation MongoDB notesAir-Shenzhen
Release time: 2015/12/17 15:20
READ: 895
Favorites: 2
Likes: 0
Comments: 0
Ensure that you have installed the Mongodb,windows installation can refer to
The day before yesterday because of work needs, began to go to the database in more than 20 million of the data in one of the duplicate data deduplication. Originally used some test data test, the day before yesterday that the method is feasible,
Update MongoDB 2.6 to 3.0 with Yum
Since the previous use of the Yum installed MongoDB 2.6 (according to the official website prompts, If you are ready to upgrade from 2.4, you need to upgrade to 2.6, then 3.0 upgrade), in order to use MongoDB
Update MongoDB 2.6 to 3.0 with Yum
Since the previous use of the Yum installed MongoDB 2.6 (according to the official website prompts, If you are ready to upgrade from 2.4, you need to upgrade to 2.6, then 3.0 upgrade), in order to use MongoDB
Installing and installing MongoDB
Download from official website
Installation
Test connection
Enable
Installing the MongoDB Windows service> d:\mongodb\bin>mongod--dbpath "d:\mongodb\data\db" --logpath "d:\mongodb\data\log\
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
The first step:Go to mongodb official website https://www.mongodb.com/download-center?jmp=nav#community Download the latest version of the installation packagePlease select the appropriate download according to your operating system version.Step Two:
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.