Note: I'm a beginner in Firebase and this question may be a duplicate.
I'm trying to store data in the Firebase Realtime database but data does not store this is a database Rule.
{
"rules": {
".read": "true",
".write": "true"
}
}
This is code:
import {ref,set, getDatabase } from 'firebase/database';
function handleAddCartItemSave(product) {
const db = getDatabase();
const uid = selectorLogin.uid;
set(ref(db, '/cart'), {
product,
uid,
});
console.log(uid, product);
}
What is a mistake in the above code?