CMDStart MongoDBD: \ MongoDB \ bin \ mongod.exe -- bind_ip 127.0.0.1 -- dbpath D: \ MongoDB \ data -- Port 27017 -- directoryperdb -- logpath D: \ MongoDB \ logs \ db.txt -- logappend
Do not close the above cmd. Open a new cmdGo to MongoDBD: \
1. When you call ensureindex to create an index, you must ensure that no index has been created on the corresponding key before. Otherwise, if the statement is not executed, the index will retain the old version.
Example: we can create a common
Speaking of PHP connected to MongoDB, have to first introduce the official PHP manual, URL in: http://us.php.net/manual/en/book.mongo.php
In PHP's Mongo extension, four types of interfaces (objects) are provided ):
1. MongoDB connection
1. MongoDB Installation
2. Start and Stop the MongoDB Service
In Linux:
Start:/data/mongdb/bin/mongod -- fork -- auth -- dbpath =/data/mongdb/DB/-- Port 27017 -- logpath =/data/mongdb/logs/log.txt
Windows: 3. MongoDB shell commands
Help show
To access MongoDB, configure the environment in windows. Of course, it is best to use Linux.
Two conditions are required:
MongoDB Server
PHP driver
Run the following command on the server:
Mkdir \ data \ dbmongod
For the PHP driver, it
I. Initial KnowledgeMongoDB
MongoDBIs a distributed collection-oriented open source database., Stable version:Http://www.mongodb.org/downloads.The MongoDB server can be deployed onLinux,OS XAndWindowsSupported on the platform32Bit and64The default
In fact, the indexes in MongoDB are similar to relational databases. They are designed to improve the efficiency of query and sorting, and the Implementation Principles are basically the same. The keys (fields) in the set can be common data types or
Traditional relational databases are generally composed of three levels: database, table, and record. MongoDB is composed of databases and collections) and document objects. MongoDB has no concept of columns, rows, and links for tables in relational
In my previous MongoDB study note, I led us to learn how to use the samus driver to perform basic data operations. In this article, I learned how to use the jqgrid table to operate MongoDB data in the MVC mode.
We can see that jqgrid is used to
Learning document
Some MongoDB knowledge points summarized by others
Http://wenku.baidu.com/view/4a210120dd36a32d737581a5.htmlgdgf
MongoDB manual, English version
Http://wenku.baidu.com/view/24954f791711cc7931b71686.html
Official website of
MongoDB Mongo csharp driver: https://github.com/mongodb/mongo-csharp-driver/downloads
For details, visit the official MongoDB website.
The following example shows a simple query:
// Create a database connection. The default local
PHP // The delimiter string is $ Querys = Array ("Name" => "Shian" ); // Number of equal values $ Querys = Array ("Number" => 7 ); // What is the value greater $ Querys = Array ("Number" => Array ('$ GT' => 5 )); // The number is greater
Data storage:
When I introduced journal, I mentioned why MongoDB puts data into the memory instead of directly storing the database storage files. This is related to MongoDB's storage and management operations on database recording files. MongoDB
ArticleDirectory
Find ()
Limit result set
Findone ()
Limit ()
Conditional operators , >= ,! =
$ Exists
Processing of null values
$ Mod
$ In & $ Nin
$ Not
$ Or
Array Operations
Count ()
Sort ()
Nosql has undoubtedly become the most popular in the database industry in recent years, and Oracle has begun to develop. I am not very familiar with non-relational databases, so I am better at learning MongoDB. Regular notes are also a good habit of
Source Address http://www.ningoo.net/html/2011/mongodb_in_a_nutshell_2.html by ningoo
After installing MongoDB through source code compilation, You need to configure and run it. In the MongoDB installation directory, there are several
MongoDB master-slave replication without verification, but one configuration role is master and oplog, And the other configuration role is slave.And the Master Ip port can be started.If it comes with verification, it will be troublesome.
MASTER:1.
For databases, a powerful management tool will greatly improve our work efficiency. For MongoDB, mongovue is such a tool. mongovue starts charging fees after version 1.0, so I still use version 0.9.7.2. It is enough for beginners. After installation
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