Query firestore from n8n

<{ | “structuredQuery”: {
“where”: {
“fieldFilter”: {
“field”: {
“fieldPath”: “level1”
},
“op”: “EQUAL”,
“value”: {
“stringValue”: “onboarding”
}
}
},
“from”: [
{
“collectionId”: “Data”
}
]
}
}

i cant query JSON data from firestore

Problem in node ‘Google Cloud Firestore1‘

Error : Unexpected token in JSON at position 2

Is there any problem with this Json query?

  • **Running n8n via npm
  • Operating system:Windows

Hi @Hussein_Al_Massalkhi :wave: Welcome to the community :cake:

Can you try this as your JSON, without that | character in before "structuredQuery"?

{
  "structuredQuery": {
    "where": {
      "fieldFilter": {
        "field": {
          "fieldPath": "level1"
        },
        "op": "EQUAL",
        "value": {
          "stringValue": "onboarding"
        }
      }
    },
    "from": [
      {
        "collectionId": "Data"
      }
    ]
  }
}
1 Like

i found better code to implement , thanks for your support!!