Search code examples
firebasefirebase-realtime-databasefirebase-console

Firebase: What's the meaning of color rows of realtime database row


I'm trying to upload Qt's log to firebase.
Here is saved file's logs.

❯ cat *.log
2019:04:01 17:51:23.831 [Info] "FireRest version_name:0.1" [../LoginApp/mainwindow.cpp:13, MainWindow::MainWindow(QWidget *)]

2019:04:01 17:51:27.417 [Debug] Construct SignUpDialog [../LoginApp/signupdialog.cpp:16, SignUpDialog::SignUpDialog(QWidget *)]

My uploading code is at below.

    QFile *file = FireRest::getLogFile();

    if (!file->open(QIODevice::ReadOnly)) {
        QMessageBox::warning(this, "warning", file->errorString());
        return;
    }

    QTextStream in(file);

    while(!in.atEnd()) {
        QString line = in.readLine();
        uploadLog(line);
    }

I'm using Firebase's REST API with put.

But, uploaded data is deleted immediately without any delete operation.

First picture is on uploading. enter image description here

this picture is after uploaded. red colored items were disappeared.

enter image description here

What stands for these yellow, green, red color for items?


Solution

  • The colors in the Firebase Realtime Database console have the following meaning:

    • Red means that the node is being deleted from the database.
    • Green means that the node is being added to the database.
    • Yellow means that the node is being updated in the database.

    If you've used the Firebase API before, you might recognize these as the child_removed, child_added, and child_changed events.

    From experience, I'd say that your first screenshot corresponds to code that performs a set(...) operation of a child under /devices/ered34wa/logs. The operation writes the new child, but removes the existing child nodes.