I'm trying to write a new document like this:
database.collection('NegociosDev').doc('Peluquerías').collection('Negocios').doc('PR01').collection('citas').add({
CheckIn: formattedDate(citaDate) + ' ' + formattedTime(horaSelec),
CheckOut: fechaFinal.toString(),
Dirección: 'Avenida Los Majuelos 54',
Negocio: 'PRIVILEGE SALONES',
Precio: pre.toString(),
Servicio: servicioSeleccionado.toString(),
extraInformation: empleadoSelect.toString(),
idUsuario: idUser.toString(),
})
But I'm getting this error everytime I try to write anything (I can read it):
Unhandled Promise Rejection: FirebaseError: Missing or insufficient permissions.
Using this rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow write: if request.auth.uid != null;
allow read;
}
}
}
I'm not doing any authentication, I'm just trying to write some stuff, but I don't want to change the rules.