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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容