In my firestore database, there is datetime table. For example :
date : 2022년 10월 3일 오전 3시 11분 22초 UTC+9
due_to :2022년 11월 2일 오전 3시 11분 22초 UTC+9
I want to load data that has later 'due_to' than DataTime.now(). So I made a code :
stream: FirebaseFirestore.instance.collection('topic')
.where('category',isEqualTo: catName)
.where('due_to',isLessThanOrEqualTo:Timestamp.fromDate(DateTime.now()))
.orderBy('vote', descending: true)
.limit(num_topic_limit)
.snapshots(),
But I saw an error saying,
The initial orderBy() field "[[FieldPath([vote]), true]][0][0]" has to be the same as the where() field parameter "FieldPath([due_to])" when an inequality operator is invoked.
I don't understand why 'vote' field and 'due_to' field is being compared here, since using multiple where() without datetime field occurred no error.
What should I do to accomplish my goal ?