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 results and view Mongovue as shown in the following figure
From the above figure can be seen from the system with three of the database, Local,admin,test, when adding a record, will automatically generate _id automatic identification.
We add the picture again, we can add it using Mongovue, as shown in the following figure.
Collections: called a collection in MongoDB, is a collection of documents. No mode, you can store a wide variety of documents. Similar to tables in MySQL.
In a relational database, each table in a relational database is a mapping of a relational model, and each table's fields are the properties of the corresponding entity and the collection of primary foreign keys, each of which needs to be defined in advance.
Document: The User collection ("table") here has a document (document can be understood as a record in MySQL). A document is a basic unit of MongoDB saving data. The storage structure of the data is the Bson format, which is the document we started adding, key value pair type.
The document can be saved to a data type: null, Boolean, String, Object, 32-bit integer, 64-bit integer, 64-bit floating-point number, date, regular expression, JS code, binary data, array, inline document, maximum, minimum, undefined type.
Gridfs: Because the size of the Bson object is limited, not suitable for storing large files, Gridfs file system for large files to provide a storage scheme, GRIDFS under the FS save is a picture, video screen and other large files.
Whether the Bson object or the large file stored in Grifs, we found that when adding a document, will automatically add _id, the difference is that the picture will automatically add after the addition of _id,chunksize,md5,legnth,aliases, These properties are uploaded after we upload the image, MongoDB analysis automatically added, the system automatically save.