The database uses the Create read (find) update (UPDATE) Delete (remove), which is also used by MongoDB;First, createAdd the document to the collection with the Insert function. For exampleCreate a database blog, add the document to the collection
Today, I would like to share with you the more interesting knowledge of MongoDB, including: aggregation, cursor.One: AggregationCommon aggregation operations are the same as SQL Server: Count,distinct,group,mapreduce. CountCount is the simplest,
The first step Of course, the preparation of work, in the bootstrap official website Download Good things, how to use the official website has been written in detail, in this is not detailed.: http://v3.bootcss.com/getting-started/ Step Twois to log
(1) Nodejs: Error Registering login sessionWorkaround:change var Mongostore = require (Connect-mongo ') to var mongostore = require (Connect-mongo ') (Express) in App.js;(2) Error connecting to database solution when connecting to MongoDB databaseIn
First in the admin database, create a user management account, and then through this account, set up a database management account.
Create a user Managed account
Use adminDb.adduser ({User: "Useradmin",PWD: "Test",roles:
1. Create a Super Useruse admindb.createUser( { user: "adminUserName", pwd: "userPassword", roles: [ { roles: "userAdminAnyDatabase", db: "admin" } ] })There are two types of superuser role, useradmin or useradminanydatabase (more access to all
This is a bit of an omission from previous articles about using MongoDB's shell to execute scripts, which is now supplemented in this blog post;One, passing in the script file on the command lineDefine a JAVASCIPRT file with the following name:
MongoDB as a non-relational database, or the addition and deletion of the traditional database has a great difference, here is just a bit of knowledge of the sketchy, the actual use of time, we Baidu a bit more detailed usage can be. Let's look at a
The data structure to query is as follows:As an example of querying the Versionlimitlist fieldMongooperations Tool class Query related statementscriteria criteria1 = Criteria.where ("Validstarttime"). GT (New Date ()). and (" Versionlimitlist ").
1> MongoDB:Http://www.mongodb.org/downloadsOfficial download, you can go to the Baidu share disk inside downloadMongoDB 2.6.5
Windows 64-bit: Http://pan.baidu.com/s/1qW0nCpIWindows 32-bit: Http://pan.baidu.com/s/1qWmG2NMLinux 64-bit:
Replica sets (replica set) is a new feature that starts with the mongodDB1.6 version, which enables automatic failover and automatic repair of feature member nodes, and the data between each db is exactly the same, greatly reducing the risk of a
The construction of the master-slave copy of MongoDB databaseWriteby:lipeng date:2014-10-22Recent projects using the location query, on the Internet to see the MongoDB support distance query, so I learned a bit mongodb, in the study summed up the
(1) Database commandsA) Add user db.adduser (' name ', ' pwd ')b) Delete user db.removeuser (' name ')c) User authentication Db.auth (' name ', ' pwd ')d) Copy database, copy db.copydatabase from Test library (' Test ', ' mydb ')e) Delete Database
First, insert a Bjson data into the databaseThe first is to define the document, then log in with the admin username password, enter the test database, insert this document into the test database ("table name and records in table")Insert results,
Backup-d Specifies the database to be backed up,-o Specifies the backup location,bin>mongodump-d test-o Backup//(backup is the back up directory, created to the bin directory by default)Recovery-d Specifies the database to revert to, which restores
Spring Dependency Injection is essentially a map structure, and key is Beanid,value is the bean corresponding to the object.How does autowired connect the defined interface to the corresponding Bean class?Does the above MongoDB self-Fongo Initialize
//Add a image_count field for each article document to record the number of images that this article containsdb[' Test.articles '].find ({' title ': ' WFC Test '}). ForEach (function(thisarticle) {//This is going to be forced to reshape, or it will
MongoDB Query Find(2012-01-05 11:38:10)reproduced
Tags:it
Category: MongoDB
MongoDB Query FindSpecifies the key to return, specifying the desired key through the second parameter of Find or FindOne.>
1, SortNeedless to say, MongoDB also support to sort data. The positive one means sorting by ASC order and negetive means by Desc.2. GroupThe Grammar of group:Description of Argument:key:the Field need to groupCond:query conditionInitial:initialize
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.