Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        4年前关闭。
                                                                                            
                
        
我想像这样存储一个嵌套节点

<html>
    <head>
        <script src="https://cdn.firebase.com/js/client/2.2.1/firebase.js"></script>
        <script language="javascript" type="text/javascript">
            var ref = new Firebase("https://mydatabase.firebaseio.com/");
            ref.child("clubs").set(
{
"03": {
    "competities":
        "102": { "aantalteams": 2 }
    }
} );
        </script>
    </head>
</html>


这在我添加竞赛ID“ 102”的行上给了我“意外令牌”错误。在Firebase中是否无法一次设置嵌套节点?或如何?

最佳答案

这是语法错误:

"competities":
    "102": { "aantalteams": 2 }


请注意,我们有"competities": "102":并没有任何意义。 (或者可能会在此处进行自动分号插入,这只会使情况变得更糟。)

也许你的意思是:

"competities": {
    "102": { "aantalteams": 2 }
}

10-04 23:26