Home > database >  A nested query mongo database
A nested query mongo database

Time:09-15



Leaders see the mongo data structure now I want to check the data in the blue box is the array

Is big roughly with the Document in the Document, there is an array in the Document, check the data in the array,

It is not easy wrote the along while no shell script

CodePudding user response:

Db. Collection. The findOne (). Xx. Xx

CodePudding user response:

reference no. 1 floor ZJCXC -- personal WeChat public same response:
the collections. The findOne () xx, xx
this how to check a range? The findOne only one?

CodePudding user response:

Db. Test. InsertMany ([
A: {{b: [1, 2, 3]}},
A: {{b: [11]}},
A: {{b:,22,23 [21]}}
])
//check a
The db. The test. The findOne (). A.
//check multiple
Db. Test. Aggregate ([{$project: {b: '$a.'}}])
  • Related