Home > database >  Springboot mongo filter how to use
Springboot mongo filter how to use

Time:09-20

Db. Sales. Aggregate ([
{
$project: {
The items: {
$filter: {
Input: "$items,"
As: "item",
Cond: {$gte: [" $$item. Price ", 100]}
}
}
}
}
])

CodePudding user response:

Cond: {$gte: [" $$item. Price ", 100]}, the key is how to write this

CodePudding user response:

 
ComparisonOperators. Gte Gte=ComparisonOperators. Gte. The valueOf (" $$item. Price "). GreaterThanEqualToValue (100);
XXX. And (" children "). The filter (" item ", gte) as (" $items ");
//.. Behind the filter () as () parameters for the input corresponding to the content of the



CodePudding user response:

Answer: upstairs brother ComparisonOperators. Gte Gte=ComparisonOperators. Gte. The valueOf (" $$item. Price "). GreaterThanEqualToValue (100);
XXX. And (" children "). The filter (" item ", gte) as (" $items ");
//. The filter (). Behind the as () parameters for the input corresponding to the content of the

I tried an error, the (" $$item. Price ") instead of (" $item. Price ") tried to pass under the

CodePudding user response:

Finally, the building Lord?
  • Related