http://coldfusion.com logo
#box-products
Title
# box-products
d

dick

03/31/2022, 3:38 PM
When did Quick drop
pluck()
and what can I replace it with?
s

sknowlton

03/31/2022, 3:46 PM
Quick's very first releases defaulted to return
QuickCollection
which were basically
CFCollection
(from Forgebox) which support cool things like pluck(). There was a big performance hit in using QuickCollections so they're still there but disabled by default. https://quick.ortusbooks.com/guide/collections#usdrenderdata
The performance hit may be less now, I'm not sure
d

dick

03/31/2022, 4:10 PM
Ah, thanks. Yes, this app was an early Quick project for me which I'm now trying to update to the latest version. I'm trying to serialize my records to JSON to store elsewhere but I only want a few of the columns. The docs say
asMemento()
supports the same args as
getMemento()
but that doesn't seem to work for me. Could I be doing it wrong?
s

sknowlton

03/31/2022, 4:15 PM
.asMemento()
is just a convenience for
.get().map( ( thing ) => { return thing.getMemento( args ); } )
and it does take the same arguments.
you might need
ignoreDefaults
if you defined a
this.memento
- Quick now does that by default so your
this.memento
stuff should only be overrides, and should go inside of
instanceReady()
d

dick

03/31/2022, 4:40 PM
I don't have a
this.memento
but adding
ignoreDefaults
sorted it. Thanks again!
e

elpete

03/31/2022, 8:26 PM
Thanks for helping out, Sam
2 Views