1

I've defined the following firestore listener:

_eventsDataListener = Firestore.instance
        .collection('events')
        .where('group_id', isEqualTo: _userData.groupId)
        .orderBy('time', descending: true)
        .limit(20)
        .snapshots()
        .listen(onEventsData);

It works only once (when entering the state), but doesn't work after that.

Some observations:

  1. If I remove the orderBy or the where conditions it works just fine
  2. In my Firebase console I can't see any (automatically) created indexes
  3. I don't get any errors (in the console) saying I should create an index
  4. Even if I create such a composite index, it still doesn't work

Any idea?

user6097845
  • 1,257
  • 1
  • 15
  • 33

1 Answers1

2

Well it seems like creating a composite index solves this issue. Still, I wonder why I didn't get any errors (in the console) saying I should create an index...

user6097845
  • 1,257
  • 1
  • 15
  • 33