i have the below query that gets me the data of my users nd the info for there last login which is stored in my security login_history array. All works as expected, the only thing i like to change is instead of having all item of lh returned on same level as the main object, i would like to create a object called history and then have all keys of lh returned under that.
SELECT META(c).id,
c.username,
c.name.fname,
c.name.lname,
c.security.admin,
c.security.password_expiration,
c.security.developer,
c.security.locked,
lh.*
FROM Contacts c
LET lh = (
SELECT h.*
FROM c.security.login_history AS h
ORDER BY h.date DESC
LIMIT 1)[0]
WHERE c._type = "user"
When i try to use
`OBJECT_ADD( lh,"day_new", 1) AS history`
it forces me to also add key and key value which i don’t want to do…