I posted a question about this yesterday but I'm creating a new one with more details. Firestore .setData is blocked by update rule not create
I've run the simulator and the rules work there. Also when I create the document and change setData
in the swift code to update
the code works. It appears to only fail when creating the document. But the catch is that when I remove the update
rule or simply change it to allow update: if false;
the setData (or seen as create by the rules) executes properly. I have no clue whats going on nor do I know of any tools for getting a better insight.
match /users_real/{userID} {
allow create: if true;
allow read: if isOwner(userID);
allow update: if (request.writeFields.size() == 1);
}
set data:
self.docRef.collection("users_real").document("adfadsf").setData(post) { (error) in
if let error = error {
print("He dead!: \(error.localizedDescription)")
}
else {
print("it worked, for now")
}
}