refi-app icon indicating copy to clipboard operation
refi-app copied to clipboard

How to query a child variable under the object? throws error

Open techttiru opened this issue 2 years ago • 2 comments

Hi, Below is my doc in firestore and i am trying to query using filter "audit.CreatedProcess" with String value of "oneTimeLoad" but it throws errors stating. how to sort it? is there any document that explains how to play with this tool for query?

image

{
  "audit": {
    "createdAt": "__Timestamp__2022-06-18T01:47:41.559Z",
    "createdBy": "author",
    "createdProcess": "oneTimeLoad"
  },
  "homeAddress": {
    "city": "To be removed"
  },
  "personId": "a5287078-eea8-11ec-af99-47bba4a2ad21",
  "residentialAddress": {}
}

techttiru avatar Aug 09 '22 21:08 techttiru

There are few other questions:

  1. How can we delete multiple docs based on collection? like SQL, delete query.
  2. How can update multiple docs based on query result? like SQL, update query.

techttiru avatar Aug 09 '22 22:08 techttiru

Hi, Below is my doc in firestore and i am trying to query using filter "audit.CreatedProcess" with String value of "oneTimeLoad" but it throws errors stating. how to sort it? is there any document that explains how to play with this tool for query?

As the error said, you can only filter and sort by just one field audit.CreatedProcess. This is limitation from Firestore, so you can not sort by name and filter by audit or vice versa

How can we delete multiple docs based on collection? like SQL, delete query.

You can only delete one by one for now (Right click and hit delete

How can update multiple docs based on query results? like SQL, update query.

No for now, it's in the roadmap

thanhlmm avatar Aug 10 '22 13:08 thanhlmm