📅  最后修改于: 2022-03-11 14:47:33.303000             🧑  作者: Mango
import { getDatabase, ref, onValue } from 'firebase/database';
function storeHighScore(userId, score) {
const db = getDatabase();
const reference = ref(db, 'users/' + userId);
set(ref(db, 'users/' + userId), {
highscore: score,
});
}