appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.54k stars 3.73k forks source link

[Bug]In Firestore for "Get Documents in Collection" method the "where condition" doesn't work for Number, Null, Boolean, Array of Numbers, Geolocation #6060

Closed RakshaKShetty closed 2 years ago

RakshaKShetty commented 3 years ago

Description In Firestore for "Get Documents in Collection" method the "where condition" doesn't work for Number, Null, Boolean, Array of Numbers, Geolocation

[What happened]

https://loom.com/share/0665bef56ad14ceb9a3b00bbeaf8594a

Steps to reproduce the behaviour:

1.Add the new data source Firestore 2.Select method as "get documents in collection" 3.Add document/collection path

  1. under where the condition
  2. add the path and the value should be a "number" data type
  3. then the output will be displayed as empty array image

Important Details

ajinkyakulkarni commented 3 years ago

@trishaanand Hey team! Can you please add your planning poker estimates with ZenHub

ajinkyakulkarni commented 3 years ago

@trishaanand @ohansFavour Hey team! Can you please add your planning poker estimates with ZenHub

trishaanand commented 3 years ago

We can infer the data types and parse them accordingly before actually executing the query, but there is no way for the user to override these data types inferred.

areyabhishek commented 2 years ago

A user reported this bug on Intercom again today. See message below: "also, i had reported this bug on discord like 3 months ago, where if you try to make firestore query with ==, <=, >= and a number, it just returns empty array where it should return proper docs. I just checked and it's still not fixed. It basically makes firestore query unusable if you want to use a number in the query."

@trishaanand @ohansFavour I can see that this issue was assigned.

sumitsum commented 2 years ago

Removing the following special data types from the scope since we would need to have few design related discussions before we can proceed with implemention: (1) GeoPoint (2) Reference (3) Timesamp. We are tracking the support for special data types here: https://github.com/appsmithorg/appsmith/issues/3741

leotom2000 commented 2 years ago

Number - works ==, <, <=, >, >=

IN - Works []

Boolean - Works "=="

Array - Not working

Geolocation - Not Working

RakshaKShetty commented 2 years ago

Still facing the issue LOOM DEMO

sumitsum commented 2 years ago

@leotom2000 can you please check out the video Raksha has shared ?

leotom2000 commented 2 years ago

@ajinkyakulkarni @rohan-arthur @sumitsum We need a functional clarification regarding this reopened issue.

Firestore offers two operators "array-contains" and "array-contains-any" The QA has tested it like a string, even in future end-users may do the same. The reason is, we are mentioning in Where condition as "Contains" image

Here the implementation is correct, but the way the general user may search is unguided. The expectation here is the user should search in an array.

(1) Should we change the dropdown to "Array Contains", "Array Contains Any" in the dropdown. The draw back is the field will be wider and inconsistent,

(2) Should we retain this and throw a error message informing the user to search in an array.

Here is the docs related to Query operator https://firebase.google.com/docs/firestore/query-data/queries

image

leotom2000 commented 2 years ago

Closing this issue as there are no changes in the implementation. A UI change is required to resolve the misunderstanding and that will be addressed by another issue below https://github.com/appsmithorg/appsmith/issues/13880