【问题标题】:Nativescript Firebase - some properties of objects are missedNativescript Firebase - 缺少对象的某些属性
【发布时间】:2017-03-01 07:41:26
【问题描述】:

我正在使用以下插件 https://github.com/EddyVerbruggen/nativescript-plugin-firebase 允许从 Nativescript 应用程序访问 Firebase。 由于某些原因,当我执行查询请求以获取我的对象时,json 对象的某些属性会丢失。 查询下方:

return firebase.query(
    data => {
        if(data.value) {
            Object.keys(data.value).forEach(key => {
                this.results.push(data.value[key]); // Here I dont get exactly the JSON, some properties disapears.....
            }
        }
    }, "/ads/", 
    { orderBy: { type: firebase.QueryOrderByType.KEY }})
    .then(result => { return result; })
);

我的数据库

类型 number 的属性未加载(totalProduct 和 state)。 问候

【问题讨论】:

    标签: android ios firebase firebase-realtime-database nativescript


    【解决方案1】:

    我发现你的 forEach 错过了一个 ')'。 修改后,一切正常。所有 JSON 属性仍然存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多