DocumentId
This section discusses how where
and field path sentinel documentId()
types works.
__name__
documentId
return __name__
, you can use documentId()
and __name__
interchangeably.
// filter
where('__name__', '==', 'abc') // equivalent to where(documentId(),'==','abc')
// orderBy
orderBy('__name__') // equivalent to orderBy(documentId())
Collection
When querying a collection by documentId(), you must provide a plain document ID, without any forward slash.

Collection Group
When querying a collection group by documentId(), FirelorsJS rejects the value if the value is not a valid full document path.


With OrderBy
The field path of documentId()
is __name__
, this is how you use it with orderBy(to order document by id).
