Home > database >  How to achieve an array of query update
How to achieve an array of query update

Time:09-25

 
{
"Usr" : 123456,
"Info" : [
{" PID ": 1," STH ":" ok "},
{" PID ": 2," STH ":" error "}
]
}

Is similar to the above data collection, query Usr the Info collection for 123456, if there is no PID for 5 items, then insert {" PID ": 5," STH ":" according to "}; If there are PID for 5 items, update the value of {5, "PID" : "someone" : "according to"}

How to write in a mongo statement, please? thank you

CodePudding user response:

For help, thank you!

CodePudding user response:

"Mongo calculation difficulty summarized in this article are part of the solution of an array
  • Related