I have a Firebase project, let's say: project-123. The project has users collection in Firestore database.
I can get all values from users with this API:
GET https://firestore.googleapis.com/v1/projects/project-123/databases/(default)/documents/users
But I want get values based on my filter query. I want get uid from exact email. Based on google, it direct me to these point:
- Use :runQuery method
- Use structuredQuery at the body
So I tried these: GET https://firestore.googleapis.com/v1/projects/project-123/databases/(default)/documents:runQuery
Payload:
{
"structuredQuery": {
"from": [
{
"collectionId": "users",
"allDescendants": true
}
],
"where": {
"fieldFilter": {
"field": {
"fieldPath": "email"
},
"op": "EQUAL",
"value": {
"stringValue": "[email protected]"
}
}
}
}
}
But, whatever my payload, the response always:
That’s an error. Your client has issued a malformed or illegal request. That’s all we know.
Anyone got ideas to solve this? I need REST API way because I'm using directus as my backend.