mdelobelle / metadatamenu

For data management enthusiasts : type and manage the metadata of your notes.
https://mdelobelle.github.io/metadatamenu
MIT License
520 stars 27 forks source link

Database from Lists #642

Open Felharrim opened 6 months ago

Felharrim commented 6 months ago

Hello. In dataview, it is possible to form an array from lists, and then, in the same way as from an array of notes, form a table using metadata (key::value) in them. This allows you to create a database (with a small amount of information) without creating several hundred extra notes. I would like to have the same option in the Metadata Menu.

mdelobelle commented 6 months ago

Hi, could you give an example of such a Dataview configuration?

Felharrim commented 6 months ago

Good afternoon @mdelobelle Here is an example text

Code Dataview

table L.text
FROM "Dataview_list_exemple" 
FLATTEN file.lists AS L
where contains(L.text, "Marc")
const MyLists = dv.pages('"Dataview_list_exemple"').flatMap(p => p.file.lists).where(p => dv.func.contains(p.owner, "Andrew"))
dv.table([ "model", "Owner", "color"], MyLists.map(b => [ b.model, b.owner, b.color]))

and a screenshot of the code results

image

Following the example of the second list, we can create a large database within one note, with elements containing a small amount of information.