1
'child_added'は正常に動作しますが、 'child_removed'は機能しません。Firebase 'child_removed'イベントリスナーが動作しない
データインデックスは ".indexOn": "status"です。
Firebaseデータ
{ "user uid" : { "-Kb8FSBMOvcposJ-iJYL" : { "createDate" : 1485140252291, "message" : "login", "response" : "none", "status" : "0", "title" : "8. sign-in" }, "-KbL6d1xrfqCBAcP7_Qu" : { "createDate" : 1485356045006, "message" : "logout", "response" : "none", "status" : "1", "title" : "sign-out" } } }
3は、上記のコードで 'child_removed' すべてが動作しません
var notiRef = firebase.database().ref('message/' + user.uid); notiRef.orderByChild('status').equalTo('wait').on('child_added', function(snapshot) { //do something... }); notiRef.orderByChild('status').equalTo('wait').on('child_moved', function(snapshot) { // not worked. }); firebase.database().ref('notification/' + user.uid + '/uid').on('child_moved', function(snapshot) { // not worked. }); notiRef.on('child_moved', function(snapshot) { // not worked. });
Firebaseイベントリスナ。 refターゲットを設定するのは問題ですか?または、indexOnを設定することに問題がありますか? (indexOnを設定する必要があります)
それは私のミスです。 思考は「削除」されましたが、入力は「移動」されました。 ありがとうございます。 – user7354286