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
demandé il y a 2 ans219 vues
1 réponse
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
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions