This is mainly about the bottom of my package, does not involve MongoDB installation, start-up, visual query and other things, will be accompanied by a number of reference addresses for everyone to study together. There are currently two main
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
Objective
It is well known that the current use of Node.js + MongoDB has become a technology stack for many companies. Thinkjs actually provides support for MONGO, although the official documentation is small, but the ORM API is guaranteed to be
Prepare test data db.user.drop ();
for (var i=10 i25 users, group by class, showing the name and sex of the user in each class, and counting the number of people in each group Db.user.group ({key: {"Class": true}, initial: {"person": []}
,
In the afternoon just set the password, forgot to save, the evening to eat a dinner back to forget. The study of a will find it is not difficult, but the internet did not search directly on the record, follow the following steps to operate
ReadDb.collection.find ()
Db.users.find (
{age: {$gt:}},
{name:1, address:1}
). Limit (5). Sort ({age:1})
Users are collection names and are searched from users;
Age is the criteria for query, the result of which is the value of
1, configuration: Mongod--dbpath=d:\mongodb\data
Mongo
2, the basic additions and deletions to check and change
Find () Update ()--Overall update, local update.
Modifier: $inc db.person.update ({"Age": 23},{$inc: {"Salary": 1000}})
The first
Examples of cursors used in MongoDB are as follows:Suppose you do the following:
Db. Xxx.remove ();
Db. Xxx.insert ({"Name": "BuleRiver1", "Age":});
Db. Xxx.insert ({"Name": "BuleRiver2", "Age":});
Db. Xxx.insert ({"Name": "BuleRiver3", "Age": 2
Copy Code code as follows:
Field Word string
$querys = Array ("name" => "Shian");
The number is equal to how many
$querys = Array ("number" =>7);
How much is the value?
$querys = Array ("Number" =>array (' $gt ' => 5));
The number
Today tried to install MongoDB in WINDOWS7 environment, encountered some problems, here to do a record.
Download software, download the installation package at MongoDB website mongodb-win32-x86_64-2008plus-ssl-3.4.3-signed
After the
The basic concept in MongoDB is a document, a collection, a databaseWith an example, some concepts in MONGO are more visually understood:Show DBS shows a list of all dataDB is the display of the current database object or collectionUse test to
Reference Source: http://www.cnblogs.com/huangxincheng/archive/2012/02/18/2356595.htmlUnable to connect--MONGODB connection error resolution because the target computer is actively rejectinghttp://blog.csdn.net/mevicky/article/details/47312751Https:/
Save data with PymongoCrawl the top250movie.douban.com/top250 film data from the Watercress movie and save it in MongoDB.items.pyclass DoubanspiderItem(scrapy.Item): # 电影标题 title = scrapy.Field() # 电影评分 score = scrapy.Field() # 电影信息 content =
Insert data Db.col.insert ({title: "MongoDB Tutorial"}) Insert Dec= ({title: "MongoDB Jiaocheng"}) Db.col.save (dec) does not have data inserted for _id 1, and if present, update dec= ({_id:1,title: "Test "}) Db.col.save (DEC) Update the
1. Windows version Installation(1), download MongoDBURL Address: http://downloads.mongodb.org/win32/mongodb-win32-i386-1.8.1.zip(2), set up MongoDB directoryunzip to the Mongdb folder below the D drive, the path is D:\MongDB3) Set the data file
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
1. Distributed read operationsThis section describes how sharded clusters and replica sets affect read operation performance.1.1 sharded cluster read operationsThe sharded cluster allows data to be split into different mongod instances in the
Sort by sort, which is equivalent to order by. The ascending order is represented by 1, and the descending order is represented by-1.For example, sort by age field in ascending order: The code is as follows:Copy code Db. user. find (). sort
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.