deserializeJSON() to query?

Curious if there is a function to in lucee to deserializeJSON directly to a query structure?

I know I can convert tje structure using QueryNew() and some logic. It would be great if I could avoid the overhead of creating the array structure using deserializeJSON 1st.

Whats the most performant method to get from json data to a query in lucce?

Not to? Is there any particular reason it needs to be in a query format? Can you not simply loop through the array returned by deserializeJSON()?

I ended up doing just that. Iā€™m lazy and queries are a lot easier to deal with than arrays. If I could go from json to a query that would really be awesome. JSON data is a total pain to deal with when not using JS.

https://cflib.org/udf/ArrayOfStructuresToQuery might help.

That said, I would be remiss if I suggested using that. Arrays are way faster to process than queries overall, and the conversion process back to a query will take resources regardless if you do it with a UDF or if there was actually a BIF to do it for you (which there is not to my knowledge).

Im using big data sets with time series data, so I just did the labor. Your spot on. thank you for the dialog.

1 Like