Original Address http://www.cnblogs.com/nbpowerboy/p/4325692.html
"Abstract" Today has entered the era of large data, especially large-scale Internet web2.0 application development and cloud computing needs of the mass storage and massive
The MongoDB fixed collections (Capped Collection) and large file management (GRIDFS) Capped Collection fixed collections (Capped Collection) are well-performing with fixed-size collections to LRU (Least Recently used the least recently used) rule
PHP operation MongoDBGridFS storage file details. Copy the code as follows :? Php initialize gridfs $ connnewMongo (); connect to MongoDB $ db $ conn-photos; select database $ grid $ db-getGridFS (); get gridfs object gridfs has
The code is as
MongoDB is a non-relational database (NOSQL) that implements object-oriented thinking (Oo thought), and each record in MONGO DB is a document object. The biggest advantage of Mongo DB is that all data persistence requires no developers to write SQL
Because MongoDB's document structure is in bjson format (bjson Full name: Binary JSON), bjson itself supports storing binary data, therefore, the binary data of the file can be directly stored in the document structure of MongoDB. However, because
MongoDB has been a constant concern. What is the legendary document database better than MySQL every day? All of this requires data to be used to talk about it. Let's talk nonsense. Let's take a look at a piece of code first. Please ignore the
MongoDB Spring-data-mongodb integration (Win10 x64) Chapter 1,
This is the first chapter of the MongoDB series and will be updated continuously by the author.1. Download
Https://www.mongodb.com/download-center#community
2. installation and
Because the document structure of MongoDB is in the Bjson format (bjson full name: Binary JSON), and the Bjson format itself supports data in binary format, you can save the data in binary format of the file directly into the MongoDB document
MongoDB stores images and other files in two ways
(This article is intended for users who can use MONGODB to integrate Spring)
1. Use Template
/*** Storage file ** @ param collectionName collection name * @ param file * @ param fileid file id * @
Because the document structure of MongoDB is in the Bjson format (bjson full name: Binary JSON), and the Bjson format itself supports data in binary format, you can save the data in binary format of the file directly into the MongoDB document
Original address: http://blog.csdn.net/sasoritattoo/article/details/16369483
Before learning must read, now there are too many resources on the Internet, therefore, the study of the internet age must not be without the help of search
Because the document structure of MongoDB is in the Bjson format (bjson full name: Binary JSON), and the Bjson format itself supports data in binary format, you can save the data in binary format of the file directly into the MongoDB document
Overview
For the MongoDB storage base Unit Bson Document object, the field value can be a binary type, and based on this feature, we can store the file directly in MongoDB, but there is a limitation because a single Bson object in MongoDB cannot be
"Suzhou needs to work to add me QQ, the introduction of fee-splitting" MongoDB advanced1. Database commandsA. How the command worksDrop command to delete a collection in the shell and Execute Db.refactor.drop (). Actually, this function actually
Delete a collection in the shell, execute db.test.drop () or Db.runcommand ({"Drop": "Test"}), and the commands in MongoDB are actually implemented as a special type of query that executes against the $cmd collection, RunCommand simply accepts the
Gridfs is a file specification that stores large files in a MongoDB database. first, how to achieve mass storage
Because the size of the Bson object in MongoDB is limited, the GRIDFS specification provides a transparent mechanism for dividing a
MongoDB does not have features that are common in relational databases, such as connectivity and complex multi-line transactions.The collection--document-->ID ID is unique within the collection to which the document belongs.Db.help () View Help at
Count + Distinct + Group
1. Count
Query the number of American students in persons.
Db. persons. find ({country: "USA"}). count ()
2. Distinct
Check the total number of countries in persons.
Db. runCommand ({distinct: "persons", key: "country"}).
MongoDB Gridfs File System
Practical Exercises
1. View the mongofile help document with the –help option
2. Put {FileName} through mongofile-h {Ip:port}-d {CollectionName}
where the-h option specifies the host name and the port number, the-d
Special indexes and collections1. Fixed set: The fixed set needs to be created in advance to look good, and its size is fixed. When a fixed collection is full, if you insert a new document again, the pinned collection automatically removes 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.