Skip to content

Tag: google-cloud-firestore

Django field not passing through serializer

Using the Django REST Framework 2.2, I have a Person model as follows in models.py:: All data is stored in a Firestore database for saving and retrieving data via the REST API. Before new entries are made into the database, a serializer is used to validate incoming POST data. The route /person takes POST requ…

Get field type of document field from firestore

Is it possible to get the field type of a field in a document? I want to create a function that looks something like this: Where field.type returns the type of the field. For example it should return something like this: Answer From the document snapshot, with document.get you can get the field value as an Ob…