Skip to main content

I have continued without success  to try and test the trigger which connect to my firestore.

I want to trigger when a new document is added to a collection. here is the code:

{
"select":
{
"fields":
{
"measureRef"
}
]
},
"from":
{
"CompletedMeasures
}
]
}

I keep getting this error

Failed to fetch a record from Firebase / Firestore
Error while retrieving: The specified query does not contain valid JSON. Unexpected token } in JSON at position 65

I have added/removed the braces but not joy.. Help please what’s wrong??

Hi @myfitter 
That is not valid JSON. 

Objects (curly brackets) should have valid key & value pairs. i.e {key: value}. Your objects just have values.  Structured query docs are here: https://firebase.google.com/docs/firestore/reference/rest/v1beta1/StructuredQuery

{

"select": {

    "fields": e
      {

       "fieldPath": "measureRef" 
  }  

  ]

},

"from": >

{

"collectionId": string,

"allDescendants": boolean

}

]

}

 

FROM DOCUMENTS: https://firebase.google.com/docs/firestore/reference/rest/v1beta1/StructuredQuery#CollectionSelector


Thanks for taking the time to respond.

Still finding my way round JSON - starting to understand it better now - that helps a lot thank you!!