Closed bryanjnelson closed 4 months ago
Yeah I'd have pins in its own file.
Update could simply be:
update User
filter .realFirstName = "Bilbo"
set {
pins += (
select Mixin::Pinnable
filter [is Mixin::Named].name = {"Sindarin", "Quenya", "South Downs"}
)
};
@CarsonF - Do you think there is enough benefit in keeping the json separated like this into languages, partners, and projects even though they could technically just be one big list of pinnables?
with
usersJson := to_json('[
{
"user": "Bilbo",
"pinnables": {
"languages": ["Sindarin", "Quenya"],
"partners": ["Dwarvish/Elvish Alliance", "Fellowship of Halfing Languages"],
"projects": ["Emyn Muil", "Arnor Lake", "South Downs"]
},
}
]'),
Basically does seeing that structure at the top introduce enough benefit to see what type of pins we are adding, over flattening that structure into a list of names and having less code overall?
I don't see much benefit...I would just flatten
@CarsonF - This seems to modifying the data correctly, but the printed output is odd to me:
[
{
"Modified Users": [
"Bilbo Baggins",
"Bilbo Baggins",
"Bilbo Baggins",
"Peregrin Took",
"Peregrin Took",
"Peregrin Took",
"Aragorn Son of Arathorn",
"Aragorn Son of Arathorn",
"Aragorn Son of Arathorn"
]
}
]
I would expect this:
[
{
"Modified Users": [
"Bilbo Baggins",
"Peregrin Took",
"Aragorn Son of Arathorn"
]
}
]
Probably something simple?
Probably something simple?
Need a distinct
somewhere.
Either
users := distinct (...)
or
modified := distinct (...)
or
modified := (select distinct users ...)
all work.
Monday task
Description
Add seeding for pinnable types; some test users now have populated
pins
for projects, languages, and/or partnersReady for review checklist