Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quering collection with a nonexistent document's property #2440

Open
macaranduba opened this issue May 1, 2020 · 0 comments
Open

Quering collection with a nonexistent document's property #2440

macaranduba opened this issue May 1, 2020 · 0 comments

Comments

@macaranduba
Copy link

@macaranduba macaranduba commented May 1, 2020

Overview of the Issue
When ordering by a non existent document property (like 'transferDate', when there is a 'date' property instead) like in the next sentence example

this.filesCollection = afs.collection('myfiles', ref => ref.orderBy('transferDate', 'desc'));

... snapshotChanges() method fires an empty array on the payload, when document changes happend. No error message is returned or logged and an empty result array is returned.

this.filesCollection.snapshotChanges()

Angular Version
Angular CLI: 9.1.3
Node: 12.16.1
OS: win32 x64
Angular: 9.1.3
Package Version

@angular/fire 6.0.0

Motivation for or Use Case
Avoid difficult to spot bugs.

Browsers and Operating System
N/A

Reproduce the Error
In collection query, just use a property that doesn't exist in the document. No error message will be returned nor log message displayed. Still, query results will be affected.

Related Issues
None

Suggest a Fix
If I didn't miss something in the documentation, I would suggest that if nonexistent properties (used in orderBy, where) are having effects on query results, it might be better to return an error or print a warning also, or instead.
Having said that, please notice that i'm new to Javascript and Firebase, so probable I missed some background or documentation reading. I don't even know in which layer this could be accomplished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.