firebase-android-sdk
firebase-android-sdk copied to clipboard
[Feature Request] Firestore SetOptions.ignoreFields()
What feature would you like to see?
We already have mergeFields(), it will be better to also have ignoreFields(). A possible use case would be when our data has a lot of fields, especially deep, nested, and dynamic ones which will be impossible to use mergeFields, while we just want to ignore one or two fields.
How would you use it?
Just the same as mergeFields(), it is just the opposite of it.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi risalfajar, thanks for your ideas! Just want to double check, in the case like
let changes = {
a: {
b : {
c: "c",
d: "d",
e: "e",
}
}
}
You suggest set(changes, SetOptions.ignoreFields("a.b.e")) is more helpful than set(changes, SetOptions.mergeFields("a.b.c", "a.b.d")) ?
@cherylEnkidu yes, especially when the fields that we want to merge are dynamically added, like an id for example. We can't use mergeFields() in that case.
I see, thanks for your suggestion again. I will make a note and discuss with the team :) Internal tracking ticket: b/228998129