I'm trying to add documents to firestore using add() method. As per the documentation add() method generates a unique ID for each document and stores it in any random order and to store it in an ordered manner we need to a timestamp field in document. Here's how I'm doing it:
def add_data(message):
message.update({u'timestamp': firestore.SERVER_TIMESTAMP})
coll_ref.add(message)
When I'm executing the above method I'm getting an error:
TypeError: ('Cannot convert to a Firestore Value', <object object at 0x104fdebe0>, 'Invalid type', <class 'object'>)
Why am I getting this error? Is there a bug in firestore Python SDK, if so then any patch has been released for this issue?