Query for MONGODB data:Find Method:function (Query, field, limit, skip, batchsize, options) {/*query : Query condition fields: Returns the column limit: Skip: batchsize: options: */}View CodeQuerying all data in a collectionDb.user.
Sort () methodTo sort documents in MongoDB, you need to use the sort () method. The sort () method accepts a document that contains a list of fields together with their sort order. To specify sort order 1 and-1. 1 is used in ascending order, and-1
MongoDB projectionThe MongoDB projection meaning is to select only the data you want, not the entire document. If a document has 5 fields, you only need to display 3, and only select 3 fields from it.MongoDB's Find () method, which explains the
None: No exception thrown
NORMAL: Throws only network exceptions, no server exceptions
SAFE: Throws network exceptions and server exceptions, and waits for the server to complete a write operation
MAJORITY: Throws a network exception and
The recent database server is somewhat unstable, has encountered the hacker's harassment, MongoDB's security has some loopholes. The first task is to add an account to the database. Before everyone was accustomed to MongoDB without security account
Enter to/usr/localCd/usr/localmkdir MymongodbCD MymongodbDownload MongoDB Compression Packwget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.4.tgzTAR-ZXVF mongodb-linux-x86_64-2.0.4.tgzEstablishing a soft connection requires a full pathLn-
a) Increase1. Add a recordDb.test.insert ({name: ' AA ', age:20});2. Add multiple RecordsThere seems to be no way to find a MySQL-like insert into tb_name values (), butJS syntax can be used in MONGO, so you can use the For loop to add multiple
MongoDB does not have the automatic growth function like SQL, if we need to implement ObjectId Auto-growth function, can be implemented programmatically. The steps are as follows:1. Create a counters collection:Db.createcollection ("counters")2.
1.Mongodb IntroductionMongoDB (named from "Humongous") is a scalable, high-performance, open-source, schema-free, document-oriented database. It is written using C + +. MongoDB Features:A. Collection-oriented storage: suitable for storing objects
1. DownloadAddress: Http://www.mongodb.org/downloads (32-bit or 64-bit choice).I downloaded: mongodb-win32-x86_64-2.4.5.zip2. DecompressionPut the mongodb-win32-x86_64-2.4.5.zip in one place and unzip it. I put it in the D:\dev directory.The path
Create a databaseUse database_name is used to create a database. This command will create a new database if the database does not exist, or it will return the existing database.Grammar:Use database_nameTo check the currently selected database using
MongoDB is?MongoDB is a database based on Distributed file storageWritten by C + +Designed to deliver scalable, high-performance data storage solutions for WEB applicationsis a product between a relational database and a non-relational database,
??Introduction to IndexesMongoDB, like traditional database indexes, also uses the B-tree index, and the vast majority of optimized mysql/oracle/sqllite indexing techniques apply to MONGODB as well.To create an index using the Ensureindex
Implementation of deleting duplicate data in DB2
The operations that we often use to delete duplicate data in DB2. The following describes how to delete duplicate data in DB2, hoping to help you learn how to delete duplicate data in DB2.
Use
Improve DB2 data backup and recovery efficiency
If it takes several hours to back up or recover a DB2 database, the backup and recovery solution will be safe in a timely manner. Or an inappropriate solution. Therefore, while considering the
Introduction to database connection pool c3p0
C3P0 is an open-source JDBC connection pool that implements data source and JNDI binding and supports JDBC3 specifications and standard extensions of JDBC2. Currently, open-source projects using 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.