-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loon and Firestore API Consolidation Proposal #22
Comments
Hey! Yea let's break this down.
Yea I wanted the semantics of
On this point, this library has definitely taken a lot of influence from Firestore. It's a collection document store after all and I originally wrote it to act as an alternative caching and reactive layer for some Firestore apps. That said, Firestore documents are always serializable map objects. Loon is a more generic store that can additionally store primitive values, or non-serializable objects since persistence is completely optional. Given that, a
Yes for sure! I write a lot of code for myself and have surely made some weird assumptions when viewed by the larger community. I'm definitely down to change things based on feedback.
💙 |
The accepted data signature could probably be loosened a bit to accept a List JSON instead of a map JSON.
Currently, I'm doing: Loon.collection('user')
.doc('home')
.createOrUpdate({'items': homeItems});
DocumentSnapshot? document = Loon.collection('user').doc('home').get();
homeItems = List<dynamic>.from(document.data['items']); |
Quick bit of feedback on an API proposal.
I was surprised that
create
fails if the document already exists. I looked for a parameter configuration option such ascreate(set: true)
but didn't find one. Instead, there'screateOrUpdate
.Loon seems to also be missing Firestore's
set(merge: true)
option which will merge maps and map values instead of overwriting the entire map, potentially deleting old keys.I saw you mention that you're still thinking about the query API.
Other than that, Loon's API is fantastic. I like the approach you took with TypeAdapters and skipping it altogether along with skipping type registration like many other libraries.
The text was updated successfully, but these errors were encountered: