1. Download the MongoDB installation packageMongoDB's official website: http://www.mongodb.org find the appropriate version to download.If you have a network, download it directly (CentOS version) and unzip the tarball.wget http://fastdl.mongodb.org/
I. Operation of MONGODB database1. Create a database
syntax:use database name
Description: Create the database if the database does not exist, or switch to the specified database
Note: If the database you just created is not in the
MongoDB provides a 64-bit installation package for each Linux distribution, and you can download the installation package on the website. : https://www.mongodb.com/download-center#communityDownload the installation package and unziptgz(The following
first, the environment preparation1, Centos72, mongodb3.4.103. Three machine IPs are: 192.168.1.100, 192.168.1.135, 192.168.1.136second, the installation of MONGDB database1, respectively in three machines for mongdb installation, specific reference
A moment to downloadOfficial website: Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.3-signed.msiThe official website may not open, will this URL directly to the Thunder download.Two environment configurationFILE-level
After the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.Enter help to see the basic Operations Command:Show DBS: Display database list Show Collections: Displays a collection
1 Viewing the documentation for the current databaseInput:Db.media.find ()System returns:{"_id": ObjectId ("5aa490f053350e04ddbd6fa6"), "Type": "Book", "Title": "Definitive Guide to MongoDB 3rd ed.", "ISBN": "978-1-4842-1183-0", "Publisher": "Apress"
Replica setAuthority authenticationA keyfile file is to be used for authentication of permissions between nodes.
Mkdir-p/mnt/mongodb/rs/config
Cd/mnt/mongodb/rs/config
OpenSSL rand-base64 741 > Mongodb-keyfile
chmod
Query based on the length of a field (title) in the collectionDb.collections. Find true " This.title.length " })// Note that kanji is not a character
Refresh the config information for the MONGOs cacheDb.admincommand ({"flushrouterconfig":1})//
On the left is the MONGODB query statement, and the right is the SQL statement. Compared with the use, very convenient.
Db.users.find () SELECT * from Users
Db.users.find ({"age": + }) select * from the users where age =
Db.users.find
Before looking at Windows install MongoDB operation is very simple, today in your own notebook installed, a variety of small problems. Refer to the online great god posts, and then record the next simple process to remember later.1.MongoDB official
MongoDB Installation :Https://www.mongodb.com/download-center after downloading, we click Mongodb-win32-x86_64-2008plus-ssl-3.4.3-signed.msi ( For the latest version of the 2017.4.16 update) in the installation path: D:\MongoDB\Server\3.6\MONGDB
DownloadDownload MongoDB, naturally in his official website to download the corresponding version of the system, I downloaded the Windows installation package.InstallationFool-mounted, not much to say. (Installed on the C drive by default.)
1. Error message[Email protected]:~$ mongod2018- Geneva-22t17: Geneva:54.672+0800I CONTROL [Initandlisten] MongoDB starting:pid=8016port=27017dbpath=/data/db --bit host=Ubuntu2018- Geneva-22t17: Geneva:54.673+0800I CONTROL [Initandlisten] DB version
MongoDB useUpdate () function updates dataDescribeIn this section we will begin to learn how to update the collection data in MongoDB.The update () function can be used for MONGODB data updates.Db.collection.update (criteria, objnew, Upsert,
MongoDB Concept Analysis:Database tables that are equivalent to SQL: CollectionDocument: Data record lines that are equivalent to SQLField: Data field equivalent to SQLTable connection, MongoDB not supportedPrimary key, MongoDB automatically sets
Development Program error Message:caused By:com.mongodb.MongoException:Executor error:Operationfailed:sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.From the program error, you can see that
Query data using DB. Table name. Find () query data If you do not specify a condition, the default query is all for example > Db.noPK.find () {"_id": ObjectId ("5a50642b908e6b07a84472a2"), " Name ":" JavaScript "," Value ":" Vue.js "} {" _id ":
DownloadMongoDB's official website is: http://www.mongodb.org/Can be downloaded on the official website, but I tried a special trouble, all found a simple way, you can download directly at this address
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