Label:Recently in the study of MongoDB database, wrote a fully automatic installation of MongoDB database shell script, for reference only, welcome to shoot bricks, the contents are as follows: #!/bin/Bash # Shell execution Options: #-N reads only the shell script, but does
The line starting with "#" is a comment and will be ignored by the interpreter.
Sh does not contain comments from multiple lines. Only one # sign can be added to each line. It can only be like this:
# ------------------------------------------ # This is an automatic IPA script, based on webfrogs IPA-build writing: # https://github.com/webfrogs/xcode_shell/blob/master/ipa-build# function: automatically for EtAO iOS app packaging, IPA packages with 14 output channels # features: fully automate
Recent interest in MongoDB, most of the online search is 2.X version, because 2.X and 3.X difference is very large, so their own reference official website, wrote this series. MongoDB knowledge is still a lot of, this series will continue to update, this article as a catalogue, easy to read, there is a problem for everyone to exchange ha. Thank you for your attention, reprint please indicate the source, tha
output and standard error to a fileCommand 2> FileName: Redirect standard error to a fileCommand 2>> FileName: Redirect standard error to a file (append)Command >> filename 2>1: redirect standard output and standard error to a file (append)Command Command Command Command Command >m: Redirect standard output to file descriptor MCommand Example:Cat file} sort > Sort.out sorts the string of file (per line) and outputs the sort results to the Sort.out file>nullfile Create an empty file NullfileSort
2 methods for connecting node. js to MongoDB database tutorial, node. jsmongodb
Preface
The MongoDB Node. js driver is officially supported by the native node. js driver. It is the best implementation so far and has been officially supported by MongoDB. The MongoDB team has
owner of the directory, and then restart MongoDB , start successfully 5 " shown. Figure 5.MongoDB Startup Successabove the way to startMongoDBmode, you need to always open the command line terminal, if you accidentally close it,MongoDBthe process is closed. MongoDBprovides a backgroundDaemonway to start the way we just need to add parameters-Forkand the--logpathcan be.
The sixth chapter recommends 4 hours of study time 10 chaptersHow to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.Database
Database management struc
bind_ip 0.0.0.0port 27017 if setting master/slave can set the following main configuration sudo./mongod--dbpath/var/lib /mongodb/--logpath/var/log/mongodb/mongodb.log--master--journal--logappend--fork from config sudo./mongod--dbpath/var/ lib/mongodb/--logpath/var/log/mongodb/mongodb.log--slave--logappend--fork--sourc
look at this article.
If you have studied MongoDB database, then the right to review, if there are errors, please correct me. If you are already a great God, then you are more welcome to your guidance.
1. Connecting to the database
Before you connect to the database, verify that the MongoDB service is turned on. Please refer to the previous section for details.
Op
Step 2. Second: Start config Server
Mkdir-p./data/shard/config #创建数据目录
./bin/mongod--port 27027--dbpath/usr/local/mongodb/data/shard/config- Fork--logpath/usr/local/mongodb/data/shard/log/config.log #启动Config Server instance
Note that here we can start like a normal MongoDB service, without adding-SHARDSVR and Configsvr parameters. Since the
CopyMongoDB replication is important, especially now that the storage engine does not support click Persistence. Not only can replication be used to deal with failover, data integration, but also read extensions, hot backups, or data sources as offline batches.
1. master-Slave copyingMaster-slave replication is the most common way of MongoDB replication. Can be used for backup, failover, read extension, and more.The basic is to build a master node an
The seventh chapter recommends 4 hours of study time 10 chaptersHow to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.node. js Operation MangodbCreate a fol
Tags: http io using Java strong for data SP problemUse of the MongoDB Shell JS (ii)The MongoDB shell is not only an interactive shell, but also can be accessed using a JS script.Advantages and disadvantages of using JS script to interact(1) No driver or language support is r
How to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.node. js Operation MangodbCreate a folder for placing today's files, NPM init initializes, and creates
First of all to ensure that the correct installation of mongodb, Installation Reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-Ubuntu-linux
Then download the mongodb driver of nodejs
Npm install mongodb
Compile a test program:
Var
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.