this is my realtime database
I use firebase realtime database, I use rules as below:
{
"rules": {
"$uid": {
".read":"$uid === auth.uid",
".write": false
}
}
}
when I use the playground rules as below it works, here I managed to read the 121212 data above.
This is my code snippet.
<script>
// Import the functions you need from the SDKs you need
import {
initializeApp
} from "https://www.gstatic.com/firebasejs/9.6.11/firebase-app.js";
import {
getDatabase,
ref,
onValue,
} from "https://www.gstatic.com/firebasejs/9.6.11/firebase-database.js";
import {
getAuth,
signInWithCustomToken,
createCustomToken
} from "https://www.gstatic.com/firebasejs/9.6.11/firebase-auth.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
</script>
The problem is, I want to read 121212 data via javascript.

