I receive a compiler error when trying to use firebase FieldValue.increment(1)
in iOS using swift. The error only says "Ambiguous use of 'increment'"
I have updated all my pods to the current versions of all firebase pods used. More specifically I am on Firebase(5.20.2) and FirebaseFirestore (1.2.1).
My code (below) is almost exactly the same as the example in the docs Seen at the bottom of this page
How can I fix this error and get the app to compile?
let docRef = db.collection("metadata").document("permanentConversions")
docRef.updateData([
"total": FieldValue.increment(1)
])
As noted in the comments, the "Ambiguous use of 'increment'" error is solved for me by changing the code in the example to
FieldValue.increment(Int64(1))
.
The compiler provides an option of double or int64 for the increment operator and I guess it does not know which one to choose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With