React-native-firebase: When key in "!=" and "array_contains" where operator turn out error!!!

Created on 19 Sep 2018  Β·  7Comments  Β·  Source: invertase/react-native-firebase

Issue

Where operator turn out error when key in "!=" and "array_contains". I do not know which part i did wrong.

import React, {Component} from 'react';
import {
    ScrollView,
    TouchableOpacity,
    Text,
    View,
    TouchableWithoutFeedback
} from 'react-native';
import firebase from 'react-native-firebase';

class ChatTicketList extends Component {

    state = {
        tickets: {}
    };

    componentWillMount() {
        firebase.firestore().collection('tickets').where('fruit', 'array_contains', 'apple')
            .onSnapshot(collection => {
                const tickets = {};

                collection.forEach(doc => {
                    tickets[doc.id] = doc.data();
                });
                this.setState({tickets})
            });
    }
}

Firebase firestore database:
firestore-array-data

Error Get From Emulator:
operator-error

Firebase cloud firestore documentation:
firebase-doc-array-contains

Environment

  1. Application Target Platform: Android
  1. Development Operating System: Windows 10
  1. Build Tools: Android SDK Version 27.0.3
  1. React Native version: 0.55.4
  1. React Native Firebase Version: 4.3.8
  1. Firebase Module: database
  1. Are you using typescript? no

Firestore Feature Request

Most helpful comment

array_contains isn't available yet. It'll be available in the next v5 rc release.

All 7 comments

array_contains isn't available yet. It'll be available in the next v5 rc release.

@Ehesp when is the expected release date for v5 rc? Is there any way to start testing array_contains now?

Within the next couple of weeks. PRs for the feature are very welcome.

On Wed, 19 Sep 2018, 18:28 Felix Chan, notifications@github.com wrote:

@Ehesp https://github.com/Ehesp when is the expected release date for
v5 rc? Is there any way to start testing array_contains now?

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/1506#issuecomment-422889908,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzZXnEIDt6NZX2oOyaaWvMgq6w0pz7Tks5ucn7IgaJpZM4WwHCN
.

@Ehesp when is the expected release date for v5 rc? Is there any way to start testing array_contains now?

Maybe it's only available for web version? you can try to test it out, maybe?

We need to do the native integration. It will probably be there on the Web,
although we've not tested it'll work with the react native environment.
Just be aware you may lose out on other modules you're using.

On Wed, 19 Sep 2018, 18:31 Luktm, notifications@github.com wrote:

@Ehesp https://github.com/Ehesp when is the expected release date for
v5 rc? Is there any way to start testing array_contains now?

Maybe it's only available for web version??

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/1506#issuecomment-422891012,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzZXt5EgrSAOVo3gkskUrOnQk8nw5_kks5ucn9-gaJpZM4WwHCN
.

@Luktm @felixchan v5.0.0-rc4 has just been published with firestore array-contains filtering support.

Note that the correct usage is with a dash (array-contains), not an underscore (array_contains).


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

@Luktm @felixchan v5.0.0-rc4 has just been published with firestore array-contains filtering support.

Note that the correct usage is with a dash (array-contains), not an underscore (array_contains).

Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

Thanks for notifying me, I appreciate it.

Was this page helpful?
0 / 5 - 0 ratings