Working in Swift..
I'm trying to call .setData(from: ) to write a Codable struct to a document in the cloud firestore database as outlined in the Firebase docs here to:
https://firebase.google.com/docs/firestore/manage-data/add-data#custom_objects
However, I'm getting the error: "Argument labels '(from:)' do not match any available overloads"
The odd thing is I was able to build and run on the simulator once, and successfully posted a document, but now obviously the compiler is calling this error and causing the build to fail. relevant code below:
the line that is causing the build to fail:
do {
try collectionRef.document(lensSet.id.uuidString).setData(from: lensSet)
} catch let error {
print(error)
}
The Codable Struct:
struct LensSet: Codable, Identifiable {
var id: UUID
// Coding KEYS
private enum CodingKeys: String, CodingKey {
case id
}
}
It seems like the function they are saying to call in the docs maybe doesn't exist? Any help appreciated!