CRUD

Create

There are two types of creating data. Creating a fields, is creatign new fields inside existing element. You enter the name and the value. It doesn't require the schema to be set. You can also add complete elment with all his predefined data. In our example, we can add new events ( with all fields ), clubs etc. This way of inserting reguires your schema to be set.

In the second method, when you create complete object (ex. events ) you have two ways of inserting your data. As a timestamp where we use the key + timestam. and As a push where we use the firebase keys to insert your new data. This is per all data and can be set up in "scr/config/app.js" in the adminConig element you will find field methodOfInsertingNewObjects


Read

Depending on the type of data to be presented, we are automatically displaying your fields in a "fields" group. If we see an array, we display it as a table. If we see regular elements we display them ad buttons in the "elements" group.

If you want your elements to be grouped in a table, in "scr/config/app.js" in the adminConig element you will find field prefixForJoin. Here you can define what kind of elements you want to be grouped into a table. In our case, all our event start with the prefix "-event". This is common practice in Firebase. Even the elements pushed in Firebase have prefix, that is different per each instance. You can use it to group you element.

Central part of our project is the "TableView" where we display your data. You can define what fields should be displayed ( in table, and in table header). In "scr/config/app.js" in the navigation on each "firebase" item you can have tableFields. This is list of fields to be displayed.


Update

Using ReactJS state change we are updating your data on fly. So there is no save button in order to update your data. Just modify your content and it is updated directly in firebase. This also applies to the HTML WYSWYG editor.


Delete

As for create, for delete you have two options. Delete single fields, that you will see at right of each field, and delete everithing in current path ( a delete button on top ). Both of them triger same fuction for deleting notifaing you that everithing under this path will be completly removed (Firebase) and that SubCollection will not be deleted for (Firestore).

View video of CRUD