An app for viewing, creating and editing items in a database

Hello and thank you for your time,

I am creating an app that will allow users to view, create and edit data items that comprise of text, images and possibly more.
These data items will have to be stored permanently in an appropriate database (I believe mongoDB is fine for unstructured data).

So the user clicks the create button and is presented with the create interface; they then enter the info (text, images, etc.) and click save. This should trigger a callback that will store the item in the database.

Simultaneously, the interface of the app has to show the entries of the database, in a list format. Each list item will be expandable (to reveal more info or options), and will correspond to one entry in the database.

The problem is, how to make sure that the app interface will be updated every time an item is entered in the database?

In my understanding, the database will be the central point where the items will be stored in and retrieved from. Ideally, the application’s interface will be able to always reflect the database’s content (but not in a tabular format, so the DataTable component doesn’t seem right for the job.

With this information, could anyone direct me on how I might achieve this? Do I need an intermediate place to store the data items before sending them to the database?

Thank you again!

Hi @gdims

I’m not sure if I understud your problem correctly but perhaps you need to use two different collections in mongo to manage this, one with the information entered by the create interface (like a temporary data), and another with all the permanent data, the first action that the “crate interface” will be doing is to delete all the info from the temporary collection, then will update both collections and then you will be showing the list using the collection that only has the information created in the last process.

Thank you, it sounds reasonable, however I’m thinking that it should be possible with just a single database containing everything. I’m looking into it, and will update this post when I get it sorted out.