-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Feature request: support array-contains
#1809
Comments
Hi @davidtlee! We support this already in the query callback. |
Hi @davideast, could you give an example or point to documentation? Using 'array-contains' within the where clause throws the following error:
This is the code I'm trying to use with version 5.0.0-rc.11 of angularfire2: |
@Matttaylor8910 I had the same issue. Searching does work as David East says, but for some reason the typings weren't correct for me locally. I had to edit the typings file for firebase, then the app started building again. Open |
@davideast thanks! it does look like it works. But I realized I was reading it wrong. I thought array-contains allows passing in an array for matching anything within the array. But I realized it only allows passing in a single value and checking if an array on the backend contains the query item. whoops! |
@leonlovett If you update to the latest Firebase version the typings should work |
I manage to solve this issue using the following dependencies version {
// all Angular deps on version 5.0.3
...
"angularfire2": "5.0.0-rc.6",
"rxjs": "5.5.4",
"firebase": "5.3.0",
"@firebase/app": "0.1.10",
...
} |
array-contains only work with string?? the examples which are given shows that it works with string but how to deal when array contains objects here how the query will be for object with name==yogi? |
Hi everyone, I just find out that a little different here: |
@hiepxanh for consistency, I think we should update this to |
|
It looks like firestore now supports
array_contains
query functionality:https://firebase.google.com/support/release-notes/js
This would be super useful for reducing the querying needed. For example if I need to get all the comments for a list of N posts, this would N individual queries. With
array-contains
, you could get them all in one query!The text was updated successfully, but these errors were encountered: