The following example inserts a user object into the MongoDB and reads it
The code is as follows
Copy Code
user.java: Package Com.mongo; public class User { string name; int age; oid _id; public String G
The compilation of PHP MONGO module
To download the current stable stable version from Http://pecl.php.net/package/mongo, the latest stable release is 1.5.2 and the installation steps are as follows:
The code is as follows
Copy
1. Download Linux version of MongoDB database
Download the MongoDB Linux version to the official download page, 32-bit or 64-bit to choose from their own situation
Http://www.mongodb.org/downloads
or download directly from the server using wget
Summary and solution of Mongodb replica set erection problem
The replica set of the MongoDB database is composed of multiple servers, one of which is the primary node, the other is from the node, and if the primary node is down, it automatically
What is MongoDB?
MongoDB is written by C + + language and is an open source database system based on distributed file storage.
In the case of high load, adding more nodes can guarantee the performance of the server.
MongoDB is designed to provide
MongoDB cluster refactoring, freeing up disk space
Since MongoDB deletes part of the data, it does not reclaim the disk space, so it frees up disk space by rebuilding the data directory.
An experimental environment
A replica set is configured
Using Gridfs file to MongoDB, return a Mongoid object, usually we need to save the $id value in this object in a string form to the database, as the identity of the file, then how does PHP take out the ID string value of the Mongoid object?
Find
MongoDB basic operation of the increase and deletion checkWe know that the most common operation of a traditional relational database is "Add/remove/Modify/query", i.e.The legendary crud (Create/remove/updte/delete).In learning MongoDB, we also
Index typeAlthough the index of MongoDB is the same on the storage structure, it is divided into several types such as unique index (unique), sparse index (sparse), multivalued index (multikey) according to different application layer
1. Download MongoDBOfficial website: https://www.mongodb.org/downloadsSpecific Link: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgzDownload the file to the specified location, for example, my downloaded file is placed in
MONGO additions and deletions to searchShow DBS shows all DBTo which db the use Fengdb is converted, without which a new db is created automaticallyDB Displays the current operation's DBDb.fengDb.insert ({"Name": "Fengnovo"}) adds a record to the
1. Each database in a MongoDB instance can have many users. If security checks are turned on, only database authenticated users can perform read or write operations.In the context of authentication, MongoDB will treat the normal data as the admin
Using MongoDB is not a lot, remember to do "parent assistant" time, used a little. It was only when I made the "dispatch system" last year that I used MongoDB again.Here is a brief introduction to the dispatch system, dispatch system in the Cloud
1. After the first installation was successful, the following problems were found instantlyMongoDB could not be started because the target computer was actively refused to connectWorkaround:This is not MongoDB can not start, is that you have not
First, copy set
Replica the schema of the set
Deployment of Replica Set
Master-Slave operation Log
Inside the Local Database: Db.oplog.rs.find ()
Basic information for the log: Db.printreplicationinfo ()
View
The following is an extension I added when I used the MongoDB extension of Codeigniter.Is to use MongoDB Aggregate to implement the Sum method in Mysql/* Controller. php */$ Option = array (Array ('$ Match' => array ('Match _ 1' => 'value _ 1
In another way, we can add a random key (random) to each document, generate a random number using the Math. random () method, and store it in the document. During query, a random number is also generated using Math. random (), and a document with a
1. PreparationsAfter installing pymongo through pip or easy_install, you can use Python to call mongodb.Then install a flask to serve as a web server.Of course, mongo has to be installed. For Ubuntu users, especially those who use Server 12.04, it
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