我需要将列表中的数据与b_age
数据进行比较,其中查询的值是动态的。我正在使用python执行查询:
firestore
此代码不适用于mail='sampoornitb@gmail.com'
doc_ref = store.collection(u'students').where(u'email', u'==', 'mail')
。
如果我使用:
NameError
一切正常。
您可以建议使用动态值作为参数的查询吗?
答案 0 :(得分:0)
不要在要传递给Firestore API的变量的名称周围加上引号。带引号的字符串实际上是在Python中获取的。 (与Firestore SDK无关。)
mail='sampoornitb@gmail.com'
doc_ref = store.collection(u'students').where(u'email', u'==', mail)