Thursday 12 November 2020

how to remove elements from array in firestore with a where clause in python

I've a sample collection in my firestore enter image description here

I've got two arrays in a document. I want to delete the whole array dictionary from two arrays if monthName is January.

Desired output enter image description here

I've tried

doc_ref = db.collection('calender').where('monthName', 'array_contains', 'January').arrayremove()

But I'm getting an error

AttributeError: 'Query' object has no attribute 'arrayRemove'

I referred the documentation, but I couldn't understand that to this problem. So, looking for help here.



from how to remove elements from array in firestore with a where clause in python

No comments:

Post a Comment