Hi
I am trying to develop a silly (!) app.
I have documents like this:
{
"_id" : "6aaPNRDjxKvvWEWgg",
"thingName" : "plane",
"thingPlural" : "Planes",
"keyDisplayTerm" : "boeing 747",
"make" : "boeing",
"model" : "747"
}
That’s the entire “database” - a collection of documents that say what they are - the “thingName” field essentially.
I can populate a dropdown at the top of the page by querying the “thingPlural” field, and getting the unique values. ie: a list that shows Planes, Cars, Trains, Sales Transactions, Parties, Cats, Dogs, Birds, Fish etc
So when someone chooses Planes from the dropdown, they’ll see a list of planes.
My keyDisplayTerm field is what gets displayed in the list of plane “things”
I’d rather have something like this:
{
"_id" : "6aaPNRDjxKvvWEWgg",
"thingName" : "plane",
"thingPlural" : "Planes",
"keyDisplayTerm" : "{{make}} {{model}}",
"make" : "boeing",
"model" : "747"
}
and be able to pass the value of keyDisplayTerm directly into a Blaze template with:
{{#each thing}}
<li>{{keyDisplayTerm}}</li>
{{/each}}
Is this possible?
I’ve had a look at the guide:
but am getting a bit lost.
Maybe I can’t do what I’m thinking, and that’s ok - this is just a wild idea I have.
(For reference, I remember the old EAV v RDBMS arguments back in the day, and have had a look at json-ld.org, just so you know where I’m coming from in terms of storing data…)
Any and all ideas (or criticisms! “are you completely mad?”) are most welcome.