Just learn MongoDB, now the information on the Internet is relatively small, read a MongoDB authoritative guide, the content is not very comprehensive. 708 together to find some of the MONGO database basic additions and deletions to check operations.
1. Download mongodb:http://download.csdn.net/detail/swazer_z/9314681 can also go to the official website to download the latest installation package: Https://www.mongodb.org/downloads
2. Extract files to a directory, and then rename:
Simple annotation: MONGOs routing process, application access MONGOs query to specific fragmentation, listening port default 27017 config Server routing table service, each with all chunk routing information shard for data storage fragmentation,
Overview and installation of MongoDB
Basic Knowledge start the Wiredtiger engine
Creating a database
Use {dbname} to view all current databases
Show DBSPS: If the use of the database is empty, can not be displayed through the show DBS Check
MongoDB self-javascript shell MongoDB Shell command db view which database is currently being directed to create Db.col.insert (POST) read Db.col.find ()Db.col.findOne () Update post.comments=[] Db.col.update ({title: "My Blog Post"},post)The update
Click to open the link
the opening of the MongoDB Default startup:$./mongodbDefault data Save path:/data/db/default port: 27017 To Modify the default path: --dbpath $./mongdb--dbpath/mongodb/points The data storage location to a directory of its
Zabbix Monitoring MongoDB
Environment
Linux Server
Configuration
MongoDB monitoring is also the use of script monitoring, mainly with the MONGO command. Monitoring Script mongodb.sh
#!/bin/bash
index=$ (echo $@ | tr "".)
Status=$ (echo
Switch to a database using use, db. Table name. Command name ({parameter}) to perform related actions. At this point the DB refers to the default switch to the DB
Lookup is usually the entire document, you need to get to a field in the document,
MongoDB and MySQL, each update of MySQL will be directly written to the hard disk, but MONGO will not, as a memory database, data operations will be written to the memory, and then to persist to the hard drive, then MONGO how to persist it?
At
Reprint: http://hi.baidu.com/i1see1you/blog/item/a8038399d9a777286e068c8a.html
1.Mongodb Bson Document database, the entire data exists on disk, HBase is a column database, each familycolumn is saved in a separate HDFs file when the cluster is
Morphia Introduction
With the rise of internet web2.0 website, the traditional relational database in dealing with web2.0 website, especially the super large-scale and high concurrent SNS type web2.0 pure dynamic website already appeared to be
The contents are as follows:
Use Demodb//using DEMODB, the following hypothetical Operation collection is Foo
2
Db.foo.remove ({"id": "Bar"})//delete a piece of data
3
Db.foo.remove (
After the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.
Enter help to see the basic Operations Command:
Show DBS: Display Database listShow Collections: Displays a
Data persistence: Persistent Data persistence method: 1. File read/write 2.cookie, server stored in the client's data, the client will automatically send the cookie to the server (the cookie is stored in the HTTP header), Session + Cookie
On the left is the MONGODB query statement, and the right is the SQL statement. Compared with the use, very convenient.
Db.users.find () SELECT * from Users
Db.users.find ({"Age": +}) SELECT * from the users where age = 27
Db.users.find ({"username":
The recent need to dump some of MONGODB data to MySQL, previously only bson packets.The initial idea is to use PHP's extension bson_decode directly,Found two tricky questions,
One is the memory consumption problem, if a bson more than 2M,
dbView the database for the current operation
show dbsShow all databases
show collectionsDisplays all collections under the current database
use database_nameConnect to a database named "database_name" and create if it does not exist
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