firebase / firebase/firebase-admin-python

[FR] Can we add `shallow` support to `Query.get` like `Reference.get`...?

Đang mở
#662 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: database type: feature request
Ngôn ngữ chính
Python
Star
1.2k
Fork
359
Merge trung bình
5 ngày 6 phút
Pull request đã merge (30 ngày)
2

Mô tả

**Is your feature request related to a problem? Please describe.**

The addition of the `shallow` parameter when retrieving data was requested in #61 and accepted in #109, but this only added the `shallow` param to `Reference.get`. I have a `Query` (`order_by_child`) that I would like to `shallow`, but `Query.get` doesn't support the param.

**Describe the solution you'd like**

I don't see any limitation to having both the `orderByChild` and `shallow` parameters in [the docs for RTDB via Rest](https://firebase.google.com/docs/database/rest/retrieve-data), but admittedly I haven't tried it yet. If there are none, can we add `shallow` to `Query.get`, too?

**Describe alternatives you've considered**

None exist, as far as I know, if I need to select a subset of paths filtered by criteria but only want the keys of those refs. Open to suggestion otherwise...

**Additional context**

_Expected_

```python
>>> just_ids_please = (firebase_admin.db
... .reference("/path/to/resource")
... .order_by_child("some/child")
... .equal_to("some_value")
...).get(shallow=True)
...
>>>
```
_Actual_

```python
>>> just_ids_please = (firebase_admin.db
... .reference("/path/to/resource")
... .order_by_child("some/child")
... .equal_to("some_value")
...).get(shallow=True)
...
TypeError: get() got an unexpected keyword argument 'shallow'
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.