title: Flutter firebase get documents where today is in between to fields - date range (startDate / endDate)
body: <p>I have some documents in my firestore with &quot;startDate&quot; and &quot;endDate&quot;.
  Now I want to get every document where today's day is between startDate and endDate.</p>
  <pre><code>final DateTime dateTime = new DateTime.now();
  final QuerySnapshot querySnapshot = await colRef
      .doc(docId)
      .collection('subCol')
      .where('startDate', isLessThanOrEqualTo: dateTime)
      .where('endDate', isGreaterThanOrEqualTo: dateTime)
      .get();
  </code></pre>
  <p>The error is very self-explanatory:</p>
  <blockquote>
  <p>I/flutter ( 5978): 'package:cloud_firestore/src/query.dart': Failed
  assertion: line 490 pos 18: 'hasInequality == field': All where
  filters with an inequality (&lt;, &lt;=, &gt;, or &gt;=) must be on the same
  field. But you have inequality filters on 'FieldPath([startDate])' and
  'FieldPath([endDate])'.</p>
  </blockquote>
  <p>But there must be a solution for my problem without filtering clientside. Is it perhaps possible to create an index for this and if so, what does it look like? Other approach would be to save anyhow the date range in one field instead of startDate/endDate, but but here I would know even less how to filter it. Such a simple problem in SQL, so hard in Firebase....</p>
  <p>Kind regards,</p>
  <p>Jakob</p>