Hi @DeutscheGabanna, I tried to use your question to teach myself some Javascript and ended up spending some quality hours typing dataviewjs into the console (Ctrl+Shift+i on Windows). But I made a little progress: I can get a list of all the keys used in the vault! Maybe you or others can progress from here. Tagging the prolific dataview helper @mnvwvnm in hopes of some further insight - I hope that is ok, mnvwvnm!
The trick I thought of was to explicitly exclude many of the Obsidian-default keys associated with a file: lots of them are arrays or large nested objects. I think my vault might have an infinite loop of pages via inlinks. Thus, the first step inside the dataviewjs block:
const excludes = ["file", "aliases", "tags", "position", "links", "inlinks", "outlinks", "etags", "frontmatter", "lists", "tasks"];
Next was just a whole bunch of ugly trial and error, which maybe someone knows how to express more elegantly than this mess of code. But it does work. To continue the same dataviewjs block:
let myFields = new Set();
Object.entries(dv.pages('"/"').values)
.forEach(([thing1, thing2]) =>
Object.keys(thing2)
.forEach(k => excludes.contains(k) ? 0 : myFields.add(k))
);
//console.log(myFields);
let myFieldsDV = dv.array(Array.from(myFields));
dv.list(myFieldsDV);
I do not know exactly what “thing1” and “thing2” represent conceptually; “k” is keys.
So, this will get you a list of inline keys from your vault that are mostly ones you have created. (I’m sure I missed filtering out some Obsidian-default ones!)
Where I got stuck: I could not figure out how to associate a file.path or even a count of notes with each key. If you see anything suspicious in the list, you’d have to do an additional search using a .where(<suspicious key>)
or something like that. Something I noticed in my vault: many of my inline Dataview fields show up twice because they are not in the standard Dataview format in my notes (e.g. my list includes both “Bed Time” and “bed-time”, even though only “Bed Time” exists explicitly in my notes).
Good luck!
PS: If anyone more fluent in Javascript/dataviewjs can chime in on better techniques/style here, I would really appreciate the learning opportunity.