-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Quick bit of feedback on an API proposal.
Proposal: Introduce a set method in Loon that behaves like Firestore's set, which can create or update a document without throwing an error if it already exists.
Example: Loon.collection('users').doc('1').set({'name': 'John', 'age': 28});
I was surprised that create fails if the document already exists. I looked for a parameter configuration option such as create(set: true) but didn't find one. Instead, there's createOrUpdate.
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.