Document DB $muliply query not working

0

We have created a documentDb instance having a 4.0.0 version. When running the query using $muliply it throws an error as Bad Query. **Query: 'test': { $multiply: ["$price", 8 ] } **When checking the documentation it says the $muliply is supported. Not sure why it throws a Bad Query

Rahul T
已提問 2 年前檢視次數 219 次
1 個回答
0

What is the error message you are getting? From the syntax of what you provided, it looks like you are missing brackets around your multiply aggregation expressions.

'test': { $multiply: "$price", 8 }

...should be...

'test': { $multiply: ["$price", 8]}

See more here: https://docs.mongodb.com/manual/reference/operator/aggregation/multiply/

AWS
Cody_A
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南