I have a parameter named parm
which can be a document name, OR a field name in a document.
I would like to check in a single query both cases.
CollectionA
docA
docB
docC
and inside a document
docA
brand
nick
So currently I can check for a document with a certain nick
, with :
db.collection("CollectionA").where("brand.nick", "==", parm)
Given that parm
can now also be a document name (docB), I would like to add an OR
to this query, to also check first if there is a document with that name in parm
, if so return that document, otherwise, check for a doc with brand.nick
if exist.