Home > database >  Directing an array of the length of the documents in Java
Directing an array of the length of the documents in Java

Time:09-27

{
"_id" : 3,
"Repos" : {
"Com" : [
{" a ": 16555," t ": 141, the" d ": 7633},
{" a ": 14358," t ": 121, the" d ": 7133},
{" a ": 12356," t ": 108, the" d ": 2137},
],
"Self" : [
{
"Forks_count" : 54,
"Id" : 7370053,
"Rank_score" : 0.0006762191350350863
},
{
"Forks_count" : 54,
"Id" : 7370053,
"Rank_score" : 0.0006762191350350863
}]
}
}
How to evaluate the self in the array of the document number?
Each great god guide

CodePudding user response:

Size command

CodePudding user response:

Building Lord:
1/f, positive solution
Db. Collection. Aggregate ([{$project: {_id: 1, CNT: {size: '$array fields'}}}])
  • Related