I use firebase to manage my project and I cannot create a query with a where clause where some value is not null.
Example: I have a team of employees. Each has a list of equipment as an object, where the key is the identifier of the equipment, and the value is color.
user = {
firstName: 'blabla',
lastName: 'bloblo',
equipments: {
123: 'blue',
124: 'red'
}
}
I would like to get all the employees who have certain equipment in the equipment. Let's say 123.
This applies to Select * from Employees, where .123 equipment is not null. I tried:
firestore.collection('employees').where(`equipments.${equipmentId}`, '!=', null)
but it does not work.
I can not make it work. Can you help me.
source
share