I need the help to query long collection with date range. See the below example document. I wanna query startTime field using date range.
For everyone recently using firbase firestore. There's a differency depending on your settings of your firebase implentation (depending on the firebase version).
Before, firestore was saving Timestamp
as a Date
, however as described here in the docs the will be replaced soon by a Timestamp
object. See the Timestamp docs here.
You can force your implementation already by adding a setting in your code to force firebase to use Timestamp objects instead of Date like this example:
var firebaseApp = firebase.initializeApp({
apiKey: [APIKEY],
authDomain: [FIREBASEAPPDOMAIN],
projectId: [PROJECTID]
});
var firestore = firebase.firestore();
var settings = { timestampsInSnapshots: true }; // force Timestamp instead of Date
firestore.settings(settings);