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

Observable collection without query should not fetch documents #1

Open
0x80 opened this issue Jan 27, 2020 · 2 comments
Open

Observable collection without query should not fetch documents #1

0x80 opened this issue Jan 27, 2020 · 2 comments
Assignees

Comments

@0x80
Copy link
Owner

0x80 commented Jan 27, 2020

My intention is that when you set no query on a collection, it fetches no documents. This behaviour seems to have changed by accident. A collection without a query now fetches all documents.

@0x80 0x80 self-assigned this Jan 27, 2020
@sallar
Copy link

sallar commented Jan 19, 2021

@0x80 but isnt that the standard firestore behavior? no query will get all documents...

@0x80
Copy link
Owner Author

0x80 commented Jan 19, 2021

@sallar True, but I found that behavior unpractical in combination with a mobx store, because sometimes at instantiation time you don't yet know what query you want to perform, but you might not want to start fetching all documents.

The way firestore-mobx works you can set the collection name when instantiating the observable, so that it is locked to that collection/type, but then at a later point initiate the query for documents.

If you do want the default behavior of fetching all documents, you can still simply do that by setting a query with only an orderBy part, which I think makes sense anyway for those types of fetches.

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

No branches or pull requests

2 participants