Document directory
Why is MongoDB used?
Date: 2012/01/16 Source: gbin1.com
Have you heard of nosql solutions? It is a popular technology in Web development. Have you heard of MongoDB? Are you ready to learn about MongoDB, one of the coolest technologies in Web development?
In this series of tutorials, we will introduce and help you understand
Software downloads
Download MongoDB Latest Package: Http://www.mongodb.org/downloadsDownload MongoDB Visual interface, mongovue:http://download.csdn.net/detail/lovesummerforever/8036417Software Installation
The MongoDB service-side installation steps are as follows:
1, adhere to the MONGODB specification, select you
This article describes a simple php Tutorial on MongoDB operations, including connection, addition, modification, deletion, and query. For more information, see MongoDB.
The code is as follows:// Connect to localhost: 27017$ Conn = new Mongo ();
// Connect to the default port of the remote host$ Conn = new Mongo ('test. com ');
// Connect to Port 22011 of the
Collect first, follow up again practice.The MongoDB cluster should be consistent with the location of MySQL because it is considered a database.There are many ways to cluster, such as sub-Library, Shard, master and slave, main master and so on.Here are some of the tutorials that are collected:Http://blog.chinaunix.net/uid-20104120-id-5012786.htmlhttp://www.ttlsa.com/mongodb/the-architecture-of-
object match, note: "Key.subkey" must be quoted
Db.collection.find ({"key": {$not:/^val.*val$/i}}) This is an operator that is used in combination with other query conditions and is not used alone. The result set obtained by the above query condition plus $not can get the opposite set.
2. Sorting
Db.collection.find (). Sort ({"Key1":-1, "Key2": 1}) Here the 1 stands for ascending,-1 for descending
3. Other
Db.collection.find (). Limit (5) controls the number of returne
The following is reproduced from the http://be-evil.org/install-mongodb-on-windows7.html
1. Download The MongoDB database for WindowsGo to the official download page to download the MongoDB Windows version. You can choose either 32-bit or 64-bit based on your own needs.Http://www.mongodb.org/downloads2. Installation preparationDecompress the downloaded package t
Tutorial on installing mongoDB database in yum under centos on a single node, centosmongodb
MongoDB deployment uses replica set + sharding to achieve high load. However, in actual testing, sometimes you only need to install a single mongodb for testing.
Below is a single mongoDB
1. Download the Windows version of the MongoDB database
Download the MongoDB version of Windows to the official download page, 32-bit or 64-bit to choose from your own situation
Http://www.mongodb.org/downloads
2. Installation Preparation
Unzip the downloaded compressed package and place it where you want to put it, create a folder called DB in the directory and a Log.txt file
DB folder for storing d
before inserting--drop drop each collection before import--oplogreplay Replay oplog for Point-in-time restore--oploglimit Arg include Oplog entries before the provided Timestamp (seconds[:ordinal]) during the Oplog replay; the ordinal value is optional--keepindexversion don ' t upgrade indexes to newest version--nooptionsrestore don ' t restore collection options--noindexrestore don ' t restore indexes--w Arg (=0) Minimum number of replicas per write
Actual operation:MongoDB B
The biggest advantage of the NoSQL database is that it supports the cluster well, and today it is ready to use MongoDB to configure a master-slave server.
About the installation of MongoDB is not introduced, I use the Mac side of the MongoDB, version 3.4.9
There are two modes of MongoDB, one is the early Master-slave m
Detailed description of Python3 simple and easy-to-understand Mongodb tutorial, detailed description of python3mongodb
Connect to database
To connect to a database, you must provide an address and interface. First, import the package.
from pymongo import MongoClientconn = MongoClient('localhost',27017)
Of course, you can write as follows:
conn = MongoClient('mongodb
MongoDB Basic Use tutorial
Basic Command Use
MONGO default port
27017
//default storage use path
/data/db//need to create manually, and give read/write permissions
//start MongoDB server
Mongod--config/usr/ local/etc/mongod.conf
//link MONGO command
MONGO
//View all data
show DBS
//DB currently in use
Create a database
Use database_name
//Do not exist t
environment variables take effect:
Copy Code code as follows:
$ source/etc/profile
Verify that the environment variable is in effect:
Copy Code code as follows:
$ mongod-version
DB version v2.6.0
2014-04-14t02:53:01.082+0000 git version:1c1c76aeca21c5983dc178920f5052c298db616c
5. Operation MongoDB
Create a Data directory
Copy Code code as follows:
$ mkdir-p
Tutorial on using external engine to operate MongoDB in Python
Tutorial on using external engine to operate MongoDB in Python
This article mainly introduces how to use MongoDB using external engine in Python, including some tips for using Django. For more information, see
Re
This article describes a simple php tutorial on MongoDB operations, including connection, addition, modification, deletion, and query. For more information, see
This article describes a simple php tutorial on MongoDB operations, including connection, addition, modification, deletion, and query. For more information, se
for naming and file names for collections are similar.After the insert is complete, you can use show collections to view all the collections under test. Use "Db.coll.find ()" To view all the data in the Coll collection under test. The whole process:When each piece of data is inserted, a "_id" field is automatically added as the ID of the data, which can be specified by itself. In fact, in general, you need to control the "_id" field, otherwise the data is much more troublesome.For example, when
Download path: Http://downloads.mongodb.org/win32/mongodb-win32-i386-1.7.0.zip
Put a DB folder I was put to D disk, path: Ddb
Extract Mongodb-win32-i386-1.7.0.zip rename it to MongoDB put it in D disk
Open cmd input: d:mongodbbinmongod.exe–dbpath=d:db start Mongod Service
Open one more cmd input: D:mongodbbin>mongo.exe
The code is as follows
C
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.