I'm executing this query on firebase firestore using python:
groups = ['AG', 'PA']
docs = db.collection(u'companies').document(company).collection('counts').\
document(count_name).collection('preprocess').\
where('status', '==', 'done').where('statuslayers', '==', 'done').\
where('statuslive', '==', 'created').\
where('load', '==', False).where('group', 'in', groups).\
order_by(u'area').stream()
for doc in docs:
print(u'{} => {}'.format(doc.id, doc.to_dict()))
This error is triggered:
Operator string 'in' is invalid. Valid choices are: <, <=, ==, >, >=, array_contains.
The sample on firebase documentation page is very near:
cities_ref = db.collection(u'cities')
query = cities_ref.where(u'country', u'in', [u'USA', u'Japan'])
return query
I couldn't find any reason to this error, if I remove the where('group', 'in', groups) clause everything works fine.
My google related packages:
- google-api-core 1.15.0
- google-api-python-client 1.7.11
- google-auth 1.10.0
- google-auth-httplib2 0.0.3
- google-cloud 0.34.0
- google-cloud-core 1.1.0
- google-cloud-firestore 1.6.1
- google-cloud-storage 1.24.1
- google-resumable-media 0.5.0
- googleapis-common-protos 1.6.0
google-cloud-firestore==1.6.1ISTM it should have that update, but you might want to double-check that it's actually there and that you're using the version of the package you think you're using. - IguananautINwas added in 1.6.0. I'm not sure why it's not working for Randolfo. - Frank van Puffelen