我正在嘗試.push
一些數據,我的火力地堡,但我在我的Chrome控制檯收到此錯誤:如何在Clojurescript中firebase.push?我的數據是否正確?
Uncaught Error: Firebase.push failed: first argument contains an invalid key (cljs$lang$protocol_mask$partition0$) in property 'arr.0'. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"
這裏是我的代碼:
fb (js/Firebase. "https://example.firebaseio.com/example-listings")
(def app-state (atom {"post" { :first_name "Billy"
:last_name "Bob"
:location "CA"
:email "[email protected]"
:website "www.pwt.com"
}}))
(def postData (get-in @app-state ["post"]))
(.push fb postData)
我也試過更換鑰匙字符串:first_name
與"first_name"
。我知道Clojure的數據結構與JavaScript有點不同。 Firebase不喜歡我的Clojure地圖嗎?