orderBy don't return any results
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
My query return expected results (but not ordered) without the orberBy
and return an empty result with the orberBy
.
try {
const results = await firestore.get({
collection: 'groups',
where: [
['departureStation.id', '==', departureStationId],
['arrivalStation.id', '==', arrivalStationId],
['dateTime', '>=', startDate.toDate()],
['dateTime', '<=', endDate.toDate()],
],
orderBy: ['dateTime', 'desc'],
});
console.log(results); // Return no result (results.empty === true)
} catch (err) {
console.log(err);
}
But without, I have expected results:
try {
const results = await firestore.get({
collection: 'groups',
where: [
['departureStation.id', '==', departureStationId],
['arrivalStation.id', '==', arrivalStationId],
['dateTime', '>=', startDate.toDate()],
['dateTime', '<=', endDate.toDate()],
],
// orderBy: ['dateTime', 'desc'],
});
console.log(results); // Return expected results (results.empty === false)
} catch (err) {
console.log(err);
}
What is the expected behavior?
Unless i’m mistaken, the orderBy
should not affect the number of retrieved results but only their orders.
I do not know if there is a connection with #46.
Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups?
{
"firebase": "^4.8.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-redux-firebase": "^2.0.1",
"redux": "^3.7.2",
"redux-firestore": "^0.2.5",
}
All browsers seems to be affected.
Thanks a lot for your help 😃
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Why does including an orderBy statement not return all records?
The returned resultset excludes records that do not have the requested field. True, but all documents should have an id field, so this...
Read more >OrderBy on ISearchQuery does not return the results properly ...
Taking advantage of the OrderBy of ISearchQuery doesn't return the items properly sorted and in some cases doesn't return items at all. E.g:...
Read more >SELECT - ORDER BY Clause (Transact-SQL) - Microsoft Learn
The order in which rows are returned in a result set are not guaranteed unless an ORDER BY clause is specified. Determine the...
Read more >cursor.sort() — MongoDB Manual
When sorting on a field which contains duplicate values, documents containing those values may be returned in any order. If consistent sort order...
Read more >ORDER BY clause - Amazon Redshift
Results are returned based on binary UTF-8 ordering. You can also specify the ... If no option is specified, data is sorted in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@QuentinBrosse
v0.2.6
includes the fix that @danleavitt0 provided. Let me know if it doesn’t work as expected.Thanks a lot, it works like a charm ! 😃