MongoDB is a cross-platform, document-oriented database that delivers high performance, high availability, and ease of scaling. MongoDB is a concept that works on collections and documents.
A document is a set of key-value pairs. The document has
My goal is to achieve:
You can search for articles with one or more keywords.
You can find the relevant articles through the list of keywords in the article.
The results of the query are sorted in descending order of relevance.
Queries are fast
Fragmentation is a way of mongodb expansion. The fragment splits a collection and stores the different parts on different machines. When the collections phase of a database is too large for the current space, you need to add a new machine.
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. The MongoDB index is almost the same as the index of a relational
1.mongodb Features
1 MONGO is a document-oriented database that brings together the features of both NoSQL and SQL databases.2 All entities are created on first use.3 does not have strict transaction characteristics, but it ensures that any data
First, insert a Bjson data into the database
First, define the document, then log in with the admin username password, enter the test database, and insert this document into the test database ("table name and records in table")
Insert the
Use skip and limit to do data paging as follows:
Code:
Page1 = Db.things.find (). Limit ()
Page2 = Db.things.find (). Skip (limit) page3
= Db.things.find (). Skip (limit). (20)
Note: Can be used for paging, limit is Pagesize,skip
The MongoDB database foreach statement circular traversal function is a very common function.A foreach loop is used to iterate, and the callback function is allowed to execute once per loop.In addition, the Foreach Loop traversal is an extension of
One recent job is to implement an API to operate a MONGODB database using Nginx + LUA, primarily to implement its count and query functions. has not written Lua before, so also reluctantly to start, in the Cloudwu Lua-mongo based on the
First, preparatory work
1. Create the table to be read in MongoDB
Create DATABASE Mongotest
Copy Code code as follows:
Use Mongotest;
Inserting data into the user table
Copy Code code as follows:
MongoDB is a database based on distributed file storage. Written by the C + + language. A high-performance data storage solution designed to provide an exhibition for Web applications. It is characterized by high-performance, easy to deploy, easy to
MANGODB Installation
1. Download MongoDB installation files, I installed the Windows 64-bit, download the address as follows:
Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.6-signed.msi
2. Create a new MongoDB folder in E-disk
Copy Code code as follows:
Initialize Gridfs
$conn = new Mongo (); Connect MongoDB
$db = $conn->photos; Select Database
$grid = $db->getgridfs (); Get Gridfs Object
Gridfs has three ways of storing filesThe first type of direct storage
Recently the company has a few new MongoDB projects (standalone MongoDB) that need to sit down and monitor. There was a monitoring template before, but the effect was not good. So I went to Google again, with the following record.Stand-alone version
Querying the document information in a collection through the Find method--------------------------------------------------------Find ()Query all document information, return finditerableWe can get the document information through the Finditerable
Linux Platform Installation MongoDBMethod One:MongoDB offers 32-bit and 64-bit installation packages on the Linux platform, which you can download on the website.: http://www.mongodb.org/downloads , select the appropriate platform version. 650) this.
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