So when I'm trying to put ref like this:
var q = _firestore.collection('users').where('age', isGreaterThanOrEqualTo: minAge).where('age', isLessThanOrEqualTo: maxAge);
to:
_Unhandled Exception: PlatformException(invalid_query, FIRInvalidArgumentException, Invalid query. You have a where filter with an inequality (lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) on field 'age' and so you must also use 'age' as your first queryOrderedBy field, but your first queryOrderedBy is currently on field 'position.geohash' instead.)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
<asynchronous suspension>
#2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#3 MethodChannelQuery.snapshots.<anonymous closure> (package:cloud_firestore_platform_interface/src/method_channel/method_channel_query.dart:55:50)
#4 _runGuarded (dart:async/stream_controller.dart:823:24)
#5 _BroadcastStreamController._subscribe (dart:async/broadcast_stream_contr<…>_
So when I'm trying to put ref like this:
var q = _firestore.collection('users').where('age', isGreaterThanOrEqualTo: minAge).where('age', isLessThanOrEqualTo: maxAge);
to:I'm getting this error: