Replies: 1 comment
-
Your issue may be due to type inconsistency or missing index. Since your field Here's how you can query: const date1 = firebase.firestore.Timestamp.fromDate(new Date('2023-12-31T00:00:00.000z'));
firestore.collection(COLLECTIONS.ORDERS)
.where('dateformatted', '<=', date1)
.get()
.then(querySnapshot => {
querySnapshot.forEach(doc => {
console.log(doc.id, '=>', doc.data());
});
})
.catch(error => {
console.error(error);
}); Make sure you have an index for the 'dateformatted' field. If the problem persists, debug by printing the error message. Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
field dateformatted is Timestamp
Why this doesn't work?
Beta Was this translation helpful? Give feedback.
All reactions