Estoy tratando de filtrar por referencia de documento en React Native. Estoy usando react-native-firebase . Quiero todos los documentos cuyo campo (DocumentReference) esté en la matriz proporcionada:
const subscriber = firestore() .collection('strategyCounts') .where( 'strategy', 'in', user.strategies.map(strategy => { return strategy.path; }), ).onSnapshot(...) user.strategies tiene este aspecto ["/strategies/id", "/strategy/id2"]
Si desea filtrar por referencia de documento, debe pasar objetos DocumentReference en la matriz. Entonces algo como:
user.strategies.map(strategy => { return firestore().doc(strategy.path); }),O (un poco más corto):
user.strategies.map(strategy => firestore().doc(strategy.path)),