我在编码方面真的很新,所以我的问题可能很简单。在下图中,您可以看到我在 Firebase 中的内容。
在 Framer 中使用此模块并编写此代码后:
response = (names) ->
print names
firebase.get("/test/items",response,{orderBy: "$key"})
我得到这样的东西:
{-L8S1RLTU3P3Lb-PxtsF:{amount:24926, date:"25.3.2018", type:"c"}, -L8S1RTNNySP0quUICNt:{amount:23616, date:"25.3.2018", type:"c"}, - L8S1RYPmG8L_EkYV8Vd:{金额:37863,日期:“25.3.2018”,类型:“b”}}
问题是我只想得到数量。当我试图将$key更改为金额时,它给了我一个错误:
{error:"Index not defined, add ".indexOn": "amount", for path "/test/items", to the rules"}
我觉得解决方案很简单,但我找不到:(