Mongodb Daily Use Commands

1, connection # mongo 192.168.0.214:27017 # mongodb://Admin: 123456@localhost/test admin User logs in to the test library with password 123456 # mongodb://admin:123456@localhost:27017,localhost:27018,localhost:27019 # mongodb://admin:123456@host1,host2,host3/?slaveOk=true # connect to three replica sets of servers, write operations in the main ...

Posted by alvinho on Fri, 12 Apr 2019 02:06:31 -0700

Redis Notes 5: Sets of Data Types

Command Description Syntax SADD add value SADD key member [member...] SMEMBERS traversal set SMEMBERS key SCARD Gets the number of key members SCARD key SISMEMBER Determines whether a member has a SISMEMBER key member Spop Random Delete Element Spop key SREM deletes the specified member SREM key member [member...] SRANDMEMBER randomly ret ...

Posted by xSN1PERxEL1TEx on Tue, 09 Apr 2019 21:00:31 -0700

Piecewise Cluster of MongoDB

Brief introduction of fragmented cluster As mentioned before, the replication set of MongoDB is mainly used to achieve automatic failover to achieve high availability. However, with the growth of business scale and the passage of time, the volume of business data will become larger and larger. Current business data may be less than several hu ...

Posted by Monadoxin on Mon, 08 Apr 2019 21:48:30 -0700

MongoDB Document Translation-CRUD Operations-Query Documents

English original address: https://docs.mongodb.com/v3.2/tutorial/query-documents/. It is a coincidence that this article is a personal translation for personal learning. If there are any mistakes, please correct them. consult your documentation Query method MongoDB provides the db.collection.find() method to read documents from collecti ...

Posted by kpasiva on Fri, 05 Apr 2019 22:36:30 -0700

Construction of MongoDB Fragmented Cluster

System Architecture Diagram Prepare 12 machines 10.202.12.178 (Main 1) 10.202.12.179 (spare 1) 10.202.12.180 (Main 2) 10.202.12.181 (spare 2) 10.202.12.182 (Main 3) 10.202.12.183 (spare 3) 10.202.12.184 (Main 4) 10.202.12.185 (preparation 4) 10.202.12.186 (Arbitration 1, Routing 1, Configuration 1) 10.202.12.189 (Arbitration 2, ...

Posted by dibyendrah on Mon, 25 Mar 2019 14:03:28 -0700

Index and query optimization of MongoDB

M The indexing mechanism of ongoDB is basically similar to that of ordinary databases, mainly in the following parts: Single field index By default, MongoDB creates a single field index of the _id field for all collections, which is unique and cannot be deleted (_id is the primary key of the collection) Index creation method: db.custo ...

Posted by mishasoni on Mon, 25 Mar 2019 06:24:28 -0700

Node.js connects to MongoDB.

MongoDB, the representative of NoSQL, has been very popular recently. Although some functions are not perfect, it does not affect its fire. Node.js is a JS language written in JavaScript that can run on the server side. So, what kind of spark will the collision produce? Today, I'll give you a simple example of how to create a new database fi ...

Posted by Tainted Kitten on Sat, 23 Mar 2019 22:27:27 -0700

MongoDB authentication -- command line mode

Abstract MongoDB3.x is quite different from previous versions. Here's a brief introduction to user authentication. 1. Understand the 3.x version of the add user function Function: db.createUser(user,writeConcern); Parameters: User This document is about user identity authentication and access related information; Write Concer ...

Posted by Coruba67 on Fri, 22 Mar 2019 00:39:53 -0700

Node.js+jade+express+mongodb+mongoose+promise to implement todolist

Promise is mainly used to solve the problem of asynchronous callback. There are several better solutions than promise. In this section, let's use promise to transform it. I wrote an article before. javascript Tencent Interview Question Learning Encapsulates a Simple Asynchronous Queue An interview question (there is a button on the page, a ul, ...

Posted by baitubai on Tue, 12 Feb 2019 14:09:19 -0800

Installation of mongodb service in yum under Mongodb - Centos7

Installation of mongodb service in yum under Mongodb - Centos7  Full stack operation and maintenance Concern 2016.06.13 18:33* Words 188 Reading 7326 Comments 1 Like 8 mongodb.png Installation of MongoDB services under centos7 can be done either by YUM or by binary decompression. Here, YUM is used. Inspection before installation ...

Posted by XTTX on Tue, 05 Feb 2019 21:48:17 -0800