Comparing Queries with a Zero Field

My Firestore collection has documents with a string field that can be null.

I expected if I ask:

Collection("products").Where("producedDate", "<", "2018-01-15")

I would get all products whose "createdDate" was earlier than "2018-10-15", including those whose "createdDate" is null.

But actually I do not get nulls.

Is this scheduled or is it a mistake?

+3
source share
1 answer

He had to work that way. The documentation states that:

, Cloud Firestore , . :

  • ,
  • [...]

, , . Date, , Date , (, null ).

null, , Where:

Collection("products").Where("producedDate", "<", "2018-01-15").Where("producedDate", "==", null)
+2
source

Source: https://habr.com/ru/post/1687720/


All Articles