WoolDoughnut310 / micropython-firebase-firestore

Firebase Firestore implementation for Micropython.
MIT License
8 stars 2 forks source link

"message": "document.name must not be set", #5

Open Tmarks2a opened 1 year ago

Tmarks2a commented 1 year ago

{ "error": { "code": 400, "message": "document.name must not be set", "status": "INVALID_ARGUMENT" } }

Getting Error on your method Create.

Found error in the json.py file

Original: def process(self, name): return { "name": name, "fields": self.data }

Updated and Working: ` def process(self, name): return {

"name": name,

        "fields": self.data
    }`

Also had some issues with your most recent pull-request,

in your Create Method,

Original: if method == "POST": response = urequests.request(method, path, data=None, json=data) else: response = urequests.request(method, path, headers=headers)

Updated and Working: if method == "post": response = urequests.request(method, path, data=None, json=data) else: response = urequests.request(method, path, headers=headers)

Submitting these for yours and others awareness. I downloaded your package through PyPI for RaspPI Pico W. May need to update package there so people have the most recent version. Thank you for your work on this package as it made it 10X easier to access firebase.

Installed version: 1.0.0 Installed to: /lib

Latest stable version: 1.0.0 Summary: Firebase Firestore implementation for Micropython optimized for ESP32. Author: WoolDoughnut310 Homepage: https://github.com/WoolDoughnut310/micropython-firebase-firestore PyPI page: https://pypi.org/project/micropython-firebase-firestore/

rhylkiio commented 1 year ago

Hello, were you able to create a document successfully?

rhylkiio commented 1 year ago

Thanks this helped especially commenting the name on the def process in json.py