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
Background
Recently I was writing a test kit with a bug-recording system, because I was using Django and MongoDB in the background, and I ran into a problem with how to implement a self added field.
The traditional relational database is very easy
Step1:
Download Https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.11.tgz The latest version, this is the linux64 bit download address, you can also go to the homepage of their own choice
Step2:
Extract the Tar vxf mongodb-linux-x86_64-2.4.
In the next chapter, this article mainly said, MongoDB group function, do or quite powerful, quite for find (), skip (), distinct (), etc., the use of more complex.
Test data:
Copy Code code as follows:
> Db.fruit.find ();
{"_id": 1
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
Mongo_db.php
throwerror (' collection cannot be empty!
');
}//Judge whether the host and port if (NULL!== $host) {$this->host = $host are passed;
} if (NULL!== $port) {$this->port = $port;
} $this->table = $table;
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
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
Today outside the whistling wind, can be in a warm cabin writing blog is also a happy North drift. Okay nonsense not to say, today mainly say PHP connection, Operation MongoDB, if you do not see the content of two, do not know how to install the
1. Storage typeThe MongoDB document is similar to JSON. But not completely JSON. There are only six types of JSON: null. bool Number, String. Array. Object.However, MONGO's documentation extends several types on the basis of JSON. For example, a
This post was last edited by the loser on 2017-5-2 09:57[Shell]Plain Text view copy code ?
0102030405060708091011121314151617
echo ‘[mongodb-org-3.2]name=MongoDB
1. Delete a field in the documentdb..update ({$unset1}} for the condition of one or some of the fields}2. Add a field to the documentdb..update ({Check the condition of one or some fields},{$set: {Field name: Field value}})Of course, this method is
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
About the default settings for the MOGODB database:1. The port default setting is: 270172. The database file location defaults to: c:/data/db, it is recommended to modify to a different disk location, you must create the Data/db folder at the root
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
All query writes as much as possible with a time-out
Bulk interfaces are used when large volumes are written
Build index as far as possible to specify as background execution
Indexes are built too much to have a certain effect on write
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
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