The first and most comprehensive overview of mongodb 3.6

Time:2020-9-24

Mongodb 3.6 take a look at part 1

The exciting moment finally came. After a mongodb listing day, mongodb finally released mongodb 3.6 RC3. It took the whole day to read release notes, and tried most of the features, and there were also pits. Interested partners can see it first.

https://docs.mongodb.com/master/release-notes/3.6/

Today’s article, will bring you a general overview, and give my personal experience of stepping on the pit.

Next, let me step on the pit for you.

Security

Here, we can see how much security we attach to mongodb, put it first. So what should be noticed?

bind_ip

Through multiple roundsBitby blackmailAfter (I guess) without affecting the development efficiency, some changes were made, andbind_ipThe default value is modified to localhost, which is also a version that has been upgraded from a previous versionpitBecause I went to watch the replcaset directly because I swept by, so I stayed here for half an hour, almost GG.

So how to solve this problem? When you start, there will be a warning about this
The first and most comprehensive overview of mongodb 3.6

So according to the prompt, we only need to add--bind_ip_allOr add it to the configuration filenet.bindIp: 0.0.0.0perhapsnet.bindIpAll: true

Other security enhancements

  • When using SSL, the opensslcipherconfig parameter is added

  • Now, as long as the server has enabled the authentication permission, the developer can only issue onegetMoreCursor request for

  • staydb.createUser()anddb.updateUser()Added inauthenticationRestrictionsParameter, which can be used to control the source IP of the request from the client side and the specified IP address of the server side of the request.(I always feel it necessary to make this function! I’m really out of my heart

  • AddedconvertToCappedMethod is used to store custom roles

Aggregation

In terms of aggregation, mongodb will perform well in every version update as always, and this time it is not too much, but I am not ready to introduce it here. Interested partners can read it by themselves or wait for the following articles to be added~

$lookup

I have to mention that$lookupCompared with that in 3.4 and 3.6$lookupIt has been strengthened and can be coordinatedletandpipelineTo make better join table queries. Let’s refer to example

Other aggregate operators

  • $listSessions

  • $listLocalSessions

  • $currentOp

  • $arrayToObject

  • $objectToArray

  • $mergeObjects

  • $dateFromString

  • $dateFromParts

  • $dateToParts

db.aggregate()

This is a new method used in theadminUnder the library, operate the events of some instances

For example:

  • $currentOp

  • $listLocalSessions

REMOVE

A new aggregation method for deleting a specified field in an aggregate

https://docs.mongodb.com/master/reference/aggregation-variables/#variable.REMOVE

Array Update Operator Enhancements

$[]

Now you can pass$[]Operator to make a one-time modification to all elements in the array, and this modification can be done by using the$divide$sumWait for the operator~

&dollar;[<identifier>]

It can be done through$[element]coordination$condCondition operator, to achieve the uniform update of the elements that meet the conditions of the array.

mongo Shell Changes

polymerization

In mongodb shell, some operation instruction sets for session are added

  • $listSessions

  • $listLocalSessions

JSON Schema

Deng Deng Deng Deng Deng~

This function is also recommended by me. Here is a brief description. Looking forward to sharing next time~

We can pass$jsonSchemaOperator to further limit the creation of sets, but do not think that this is mongodb compromise to RDB.

Instead, mongodb kept himFlexibleFeatures, through therequiredProperty to control which fields are mandatory and which can not be consistent.

And!!! Also addeddescriptionAttribute, which is used to annotate the fields, so that other developers, including dbaers, can see at a glance.

Replica Sets

In the replica set, some functions and instruction sets have been added, which are not the most attractive to me. What attracts me most is how to add authentication mode online now! No need to restart! That’s right. Say goodbye to those midnight windows! Only mongodb can do it! Only!

In addition, our oplog can also be hot reset!

  • Started discarding replica set agreement version 0

  • Replsetresizeoplog is added to hot reset the size of oplog, no need to restart!

Sharded Clusters

An instruction set is added to control the number of concurrent tasks for sharding

ShardingTaskExecutorPoolMaxConnecting

Other enhancements

  • A similar UUID is added to each collection

  • An index cannot be named with an asterisk*

  • Now if there are any documents on the multi key index, you can index them

  • adminCommandInlistDatabaseSome parameters have been added https://docs.mongodb.com/master/reference/command/listDatabases/#dbcmd.listDatabases

    • nameOnly

    • filter

  • Now network transmission, supportzlibThe protocol is compressed

OK, today’s content will be shared here. The next time the content is a little tangled, will you give me some advice? You can either personally believe me or leave a message below.

  1. Online authentication mode of mongodb 3.6 replcaset

  2. Interpretation of mongodb 3.6$jsonSchema


I am Shanghai xiaopang [miracle young], focusing on the Devops of mongodb, mysql, redis and other open source databases, embracing open source and accepting fees.

Original address of Shanghai xiaopang https://segmentfault.com/u/shanghaixiaopang/articles

Welcome to comment.

Every Friday, please look forward to Shanghai xiaopang.

If Xia Yuhe is still waiting for me by Daming Lake, I will not change.

Recommended Today

Solutions to leetcode problems and knowledge points 1. Sum of two numbers

Title Link 1. Two Sum  difficulty: $/ color {00965e} {easy}$ Knowledge points 1. Hash (hash) function The classic hash function times33 is widely used, and the core algorithm is as follows: hash(i) = hash(i-1) * 33 + str[i] Laruence has an article about:Hash algorithm in PHP 2. Hash collision processing method 2.1 chain address method […]