Category : mongodb

Order This article mainly introduces how to use mongo shell to connect remote databases. install curl -o mongodb-linux-x86_64-3.2.4.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.4.tgz tar -xvf mongodb-linux-x86_64-3.2.4.tgz The bin in this one contains mongo shell mongo mydb –username user1 –host 192.168.99.100 –port 27017 –password No parameter is passed after –password, and you will be prompted at the command line. View ..

Read more

Create/etc/yum.repos.d/mongodb-org-4.0.repoFile, edit content is as follows: [mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc Run the following command to install the latest version of mongodb: sudo yum install -y mongodb-org Configurationmongod.confAllow remote connections: $ vim /etc/mongod.conf # Listen to all ip address bind_ip = 0.0.0.0 Start mongodb: sudo service mongod start To create an administrator user: ..

Read more

Project address:https://github.com/jrainlau/mongoose_cru … Write at the beginning This article mainly shares how I use express+mongoose to add, delete, modify and check mongodb. Thank youcnodeThe help of all the excellent articles in the community and the open source project of @airuikun.airuikun/mongoose_crudThe inspiration to me.I have been studying nodejs for less than half a month and have ..

Read more

import java.net.UnknownHostException; import com.mongodb.BasicDBObject; import com.mongodb.DB; import com.mongodb.DBCollection; import com.mongodb.DBCursor; import com.mongodb.DBObject; import com.mongodb.Mongo; public class HelloMongoDB { private static Mongo mg; private static DB db; private static DBCollection col; public static void main(String[] args) throws UnknownHostException { HelloMongoDB hello = new HelloMongoDB(); if (mg == null) { mg = new Mongo(“127.0.0.1”, 27017); } if ..

Read more

import java.net.UnknownHostException; import com.mongodb.BasicDBObject; import com.mongodb.DB; import com.mongodb.DBCollection; import com.mongodb.DBCursor; import com.mongodb.DBObject; import com.mongodb.Mongo; public class HelloMongoDB { private static Mongo mg; private static DB db; private static DBCollection col; public static void main(String[] args) throws UnknownHostException { HelloMongoDB hello = new HelloMongoDB(); if (mg == null) { mg = new Mongo(“127.0.0.1”, 27017); } if ..

Read more

mongod –dbpath /usr/local/var/mongodb 2018-07-03T10:50:12.444+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify –sslDisabledProtocols ‘none’ 2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] MongoDB starting : pid=44555 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=huhaifengdeMacBook-Pro.local 2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] db version v4.0.0 2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51 2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] allocator: system 2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] modules: ..

Read more

It was installed directly with MSI, and there was a problem during startup. How do you solve it? The following is my log file: C:UsersAdministrator>mongoMongoDB shell version v3.4.7connecting to: mongodb://127.0.0.1:270172017-08-16T23:45:23.316+0800 W NETWORK [thread1] Failed to connect to 127.0.:27017 after 5000ms milliseconds, giving up.2017-08-16T23:45:23.317+0800 E QUERY [thread1] Error: couldn’t connect tover 127.0.0.1:27017, connection attempt failed :connect@src/mongo/shell/mongo.js:237:13@(connect):1:6exception: ..

Read more