1 Creating an Index1 is a positive-order index, and 1 is a negative-order indexIndexing increases query time by pressing, reducing insertion timeDb.books.ensureIndex ({number:1})2. Create an index, specify a nameDb.book.ensureIndex ({name:-1},{name:
Polymerization aggregate
Aggregation (aggregate) is primarily used to calculate data, similar to sum (), AVG () in SQL
Grammar
db.集合名称.aggregate([{管道:{表达式}}])Pipeline
Pipelines are typically used in UNIX and Linux to input
Sharding
In MongoDB there is another cluster, that is, sharding technology, can meet the needs of a large number of MONGODB data volume growth
When MongoDB stores a huge amount of data, a machine may not be enough to store data, or it
1. Enter into the/usr/java, Cd/usr/java2. New Mongodbmaster-slave,mkdir Mongodbmaster-slave3. Go to the Mongodbmaster-slave folder, create a new master and slave folder, mkdir master slave4. Enter the master and slave, create a new data and log file,
The three parameters of the MongoDB Update method are Upsert, which is a Boolean type and the default is False. When it is true, the Update method first finds the record that matches the first parameter, and when it is updated with the second
In the start Mongod error, there is a place because the/data/db permissions is wrong, because to create the directory requires root permission, after the creation of a chown xxx/data to change the directory to the current user, or start will error,
file:///E:/BaiduNetdiskDownload/Online Book store source/new Folder/boutique dedication. NET Full Employment video Tutorial 10-mvc%20oa Project/11.%20 Review Permissions module%20 workflow start/mongodb/mongodb Learn notes (a)%20mongodb introduction
MONGO the storage of data is very arbitrary, it becomes more complex when you need to modify an array object in an object.Class objects in a class can be passed directly through the "." Example: Department.User.nameThe object in the class is an
One, MongoDB data query(1) MongoDB uses the Find function to query data, with the same functionality as the Select function in SQL, which can provide many functions similar to the relational database, including mapping, sorting, and so on.Db.
Download work:wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.4.5.tgzUnzip the downloaded file to the specified directoryTar XF mongodb-linux-x86_64-rhel62-3.4.5.tgz-c/usr/MV mongodb-linux-x86_64-rhel62-3.4.5 MONGOCreate data
On the new version (2.***) of C # usage, there is basically no online. Yesterday to toss a half-day, to construct the server, found that the new version is not required, the document is such, the general meaning, do not need to get the server, like
* from Step1 where Xingbie = ' female '; for example, query all girls, and age~* from step1 where Xingbie = ' women ' and nianling = and Xianzaisuozaidi = ' Beijing '; the third reason: the database can not play itself, to the PHP,. NET, JSP and
Introduction of MongoDB dependency in Pom.xml org.springframework.boot Spring-boot-starter-data-mongodb Org.projectlombok lombok org.springframework.boot Spring-boot-autoconfigure RELEASELombok-is a simple form of annotations
1.MongoDB operations commands for common operations 1.1 databases1. Create the database and use the command with the database name , such as using SXF.* Note: 1.the name of the database followed by the use command, if present, is entered into this
Download the MONGO installation package (recommended version after 3.0) version from the official website select the download link:https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl?_ga=2.21045944.28077375.1495245189-20472680.1495115198
To
Some additions and deletions of MongoDB change the command operation: Official document reference https://docs.mongodb.com/manual/reference/method/ #查看当前mongod下有哪些数据库: Show dbs# enters or creates a database: UseDatabase name Use db_name#查看当前数据库下,
Connect to MongoDB:public class Genericmga{private DB Db;public db Getdb () {return this.db;} public void Setdb (db db) {this.db = db;}}Dbcollection coll = null;coll=getdb (). GetCollection ("Collname");//name equivalent to MySQL table name when
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