Create a databaseThe syntax format for MongoDB database creation is as follows:use DATABASE_NAMEIf the database does not exist, create the database, or switch to the specified database.If you want to see all the databases, you can use the show DBS
1 MongoDB Several startup methods start the MongoDB service there are two ways, the foreground start or daemon mode start, the former will need to keep the current session cannot be closed, the latter can be used as the system fork Process execution,
1. Create a new Dockerfile fileDockerfile
12345678910111213141516
# VERSION 0.0.1FROM ubuntu:latestMAINTAINER lanhong Turnbull "[email protected]"# Add 10gen official apt source to the sources listRUN apt-key adv --keyserver
First, introduce the advantages of the following mongodb:· High scalability· Distributed storage· Low cost· Flexible structureMongoDB Installation and Environment construction under window platform:1. Download the installation package or compress
#./mongod2018-04-15t18:52:36.352+0800 i control [initandlisten] mongodb starting : pid=36578 port=27017 dbpath=/data/db 64-bit host= Ibg-opensource-db-cwt132018-04-15t18:52:36.352+0800 i control [initandlisten] db version v3.6.22018-04-15t18:52:3
First step: Download the MongoDB installation version for installationHttps://pan.baidu.com/s/1X3hIqORJ61TCG1UJ_yr6agThe installation steps are the next step, and it's easy to say nothing.Step Two: Set the path DBPath the Mongod.exe point to the
First, prefaceThe date type in MongoDB is no time zone concept, the default storage is Isodate ("2018-04-02t13:19:16.418z") This format of 0 time zone, eight hours later than Beijing time.There is a problem in the work, how to query the document
3.4 of: Http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-v3.4-latest-signed.msi?_ga= 2.7045623.410933966.1512521590-461885398.1512521590Download page for official website: Https://www.mongodb.com/download-center?jmp=navDownloaded
MongoDB has $lookup can do a long table queryAs an example,Db.orders.aggregate ([{$lookup: { from'inventory', "item", "sku", as"inventory_docs" }}])The above code means that the item field is taken from the order table as a query condition
Here is an example of installing CentOS monggodb3.4 version, which can be found in the website installation tutorialThe steps are as follows:1. Configuring MongoDB ym Sourcevi/etc/yum.repos.d/mongodb-org-3.4. RepoThe contents of the file
MongoDB installation startsThe download and installation of MongoDB is the same as the usual app.MongoDB Preparation work:1. Create two folders in the directory where Mongodb is installed: for example: mongodb\data\dbMongodb\data\log\mongod.logHere
Method One,db.集合名.find({con_date:new Date("2018-08-13")})db.集合名.find({con_date:ISODate("2018-08-13")})Method Two,db.集合名.find({con_date:{‘$gte‘:ISODate("2010-12-21"),‘$lt‘:ISODate("2010-12-22")}})Note: Use GTE and LT formMethod Three,db.集合名.find({con_
MongoDB Limit () methodIf you need to read a specified number of data records in MongoDB, you can use the MongoDB limit method, and the limit () method accepts a numeric parameter that specifies the number of record bars read from MongoDB.GrammarThe
I. Creating Databases and TablesExecute MONGO in the bin directory into MongoDBBuild LibraryUse demo1 to create a database , mango syntax, using, if you currently have this database will be used,If not, create it. But it's not going to show up right
1 PrefaceMycat currently supports JDBC-connected back-end databases, which theoretically support any database, such as Oracle, DB2, SQL Server, and so on, to emulate it as MySQL, so only standard SQL statements are supported for other databases,
Authorized users ReadWrite have read and write access to the Test1 library:> use test1switched to db test1> db.createUser({user: "readwrite",pwd: "readwrite",customData: {description: "测试用户readwrite"},roles: [{role: "readWrite",db: "test1"}]})Verify
MongoDB Basic InformationMongoDB is an open-source NoSQL database implementation. The repository provides images of each version of MongoDB 2.2 ~ 2.7.How to useThe database is started by default on the 27017 port.-d mongoConnect to a container using
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