Mongo特性 之 4.2

1
docker run --name mongo-4.2 -p 27017:27017 -d mongo:4.2

Distributed Transaction

  • 4.0支持multi-document ACID transactions

  • 4.2支持multi-document ACID transactions on sharded clusters

High Availablity

  • 4.0支持Retryable Write

  • 4.2支持Retryable Read

Wildcard Index

1
2
3
4
5
6
7
8
9
10
11
{ "userMetadata" : { "likes" : [ "dogs", "cats" ] } }
{ "userMetadata" : { "dislikes" : "pickles" } }
{ "userMetadata" : { "age" : 45 } }
{ "userMetadata" : "inactive" }

db.userData.createIndex( { "userMetadata.$**" : 1 } )

db.userData.find({ "userMetadata.likes" : "dogs" })
db.userData.find({ "userMetadata.dislikes" : "pickles" })
db.userData.find({ "userMetadata.age" : { $gt : 30 } })
db.userData.find({ "userMetadata" : "inactive" })

该功能只在Mongo Altas服务提供 Mongo Altas = Cloud-hosted MongoDB service on AWS, Azure, and GCP

How Atlas full-text search works

参考