-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Apparently, at the moment there is no functioning python client which can filter query results by document id. To my understanding, this should work by simply putting __name__ as field value in any where/order clause like in this example:
from google.cloud import firestore_v1
db = firestore_v1.Client()
# query user data
query = db.collection('users').where(firestore_v1.field_path.FieldPath.document_id(), '==', '...').stream()
dicts = []
for doc in query:
dicts.append(doc.to_dict())
print(dicts)
However, this code will throw the following exception:
__key__ filter value must be a Key
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/python-firestore API.Issues related to the googleapis/python-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.