'How to check if array value exist in a document?

see firestore image here

i have document in firestore which has array of products now am struggling how to check if products already exist in such array so that user should not add same product multiple times.how to check for the exixtance of product in that array.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source