feat(query): support FieldsPath.documentId in where
See original GitHub issueDo you want to request a feature or report a bug?
bug
What is the current behavior? Firestore gives you chance to use :
db
.collection('books')
.where(FieldPath.documentId(), '==', 'fK3ddutEpD2qQqRMXNW5')
.get()
But I cant use FieldPath.documentId in:
firestore.setListener({
collection: ...,
where: [ FieldPath.documentId(), '==', 'fK3ddutEpD2qQqRMXNW5' ],
I have to hack it with:
firestore.setListener({
collection: ...,
where: ['__name__', '==', 'fK3ddutEpD2qQqRMXNW5' ],
What is the expected behavior? To be able to write:
firestore.setListener({
collection: ...,
where: [ FieldPath.documentId(), '==', 'fK3ddutEpD2qQqRMXNW5' ],
Which versions of dependencies, and which browser are affected by this issue? Did this work in previous versions or setups? redux-firestore@0.6.0 Steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Firebase FieldPath.documentId() where query issue
You can't access FieldPath as a property of the db instance. Without seeing what's in ../firebase/init , it's not possible to say for...
Read more >FieldPath - Firebase - Google
Returns A special sentinel FieldPath to refer to the ID of a document. It can be used in queries to sort or filter...
Read more >cloud_firestore 0.14.3+1 | Flutter Package - Pub.dev
mergeFields; FEAT [WEB] adds GetOptions support for querying against server/ ... DEPRECATED: documentID has been deprecated in favor of id . ... FieldPath...
Read more >Node / Firestore query on auto-ID returns "no documents found"
Can you provide the reproduction here or tell me the ticket number you have with support? To be clear FieldPath.documentId() is nothing more...
Read more >Migration Guide | FlutterFire
CHORE: migrate to platform interface. FEAT: support multiple firebase apps. RemoteConfig.instanceFor() can be used to retrieve an instance of RemoteConfig for a ...
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
This feature would be great for getting several documents.
For example:
where: [FieldPath.documentId(), "in", [2,5,9]]
Thanks for the replies! @sreeharicubet I was using that to begin with, and it worked, but realized a bit later that
in
queries are limited to 10. So ended up going with this, which seems to accomplish what I was hoping for (and no 10 limit):