firebase实时数据库的更改在控制台中不可见

发布于 2025-02-13 18:26:15 字数 1156 浏览 0 评论 0原文

我正在学习使用Firebases实时数据库,并偶然发现了错误。如果我通过设置更改数据,这些更改在Firebase的控制台中不可见,但是如果我尝试访问通过Get Awere设置的数据,则可以。

我想看到更改

这是这里的初始化代码

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

是用于引用,设置和获取的代码

onPressed: () => {
          print("button"),
          FirebaseDatabase.instance
              .ref("/")
              .child("users")
              .set({"name": "test", "int": 875})
              .then((value) => print("set value"))
              .onError((error, stackTrace) => print("$error, $stackTrace")),
          FirebaseDatabase.instance
              .ref("/")
              .child("users")
              .get()
              .then((value) => print(value.value))
              .onError((error, stackTrace) => print("$error, $stackTrace")),
        },

I'm learning to use Firebases realtime database and stumbled upon an error. If I change data via set those changes aren't visible in the console of firebase but if i try to access the data I set via get everything is fine.

There`s where I want to see the changes
enter image description here

Here is the initialization code

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

Here is the code for referencing, set and get

onPressed: () => {
          print("button"),
          FirebaseDatabase.instance
              .ref("/")
              .child("users")
              .set({"name": "test", "int": 875})
              .then((value) => print("set value"))
              .onError((error, stackTrace) => print("$error, $stackTrace")),
          FirebaseDatabase.instance
              .ref("/")
              .child("users")
              .get()
              .then((value) => print(value.value))
              .onError((error, stackTrace) => print("$error, $stackTrace")),
        },

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文