When querying a collection with an in filter on a documentId, passing an array of strings will not work, instead returning an error
Repro:
from google.cloud import firestore
client = firestore.Client("your-project-id")
collection = client.collection('0')
query = collection.where("__name__", "in", ["hello", "world"])
[i for i in query.stream()]
Node.js handles this today by validating the reference and as part of it doing a conversion. It would be convenient for go users if a similar conversion were done.
Referenced Node Code: https://github.com/googleapis/nodejs-firestore/blob/9a1a9dcd56dc125159be3ce7356a6ebce04519a9/dev/src/reference.ts#L1646
This code works today, so this is a matter of detecting the type mismatch with DocumentID queries and adjusting it on the user's behalf.
from google.cloud import firestore
client = firestore.Client("crwilcox-firestore")
collection = client.collection('0')
docRefs = [
collection.document("hello"),
collection.document("world")
]
query = collection.where("__name__", "in", docRefs)
[i for i in query.stream()]
Related Go Issue: googleapis/google-cloud-go#4151