Categories
- General (21)
- Talking (9)
- Thinking (57)
- Apple (2)
- Browsers (3)
- Business (16)
- Databases (6)
- MySQL (3)
- SQL Server (1)
- Design (2)
- E-commerce (3)
- Marketing (2)
- Mobile (1)
- Networking (2)
- Programming (29)
- ColdFusion (23)
- Java (1)
- Javascript (5)
- PHP (6)
- Ruby (1)
- Web 2.0 (3)
- Web Servers (3)
- IIS (3)
- Windows (11)
- Walking (1)
Archives
- February 2010 (1)
- January 2010 (13)
- December 2009 (3)
- July 2009 (2)
- June 2009 (1)
- May 2009 (1)
- April 2009 (8)
- March 2009 (6)
- February 2009 (15)
- January 2009 (4)
- December 2008 (3)
- November 2008 (2)
- September 2008 (2)
- August 2008 (2)
- November 2007 (2)
- September 2007 (1)
- April 2007 (5)





JSON format and serializing ColdFusion query objects
Every so often there is a tiny problem that has you scratching your head until you RTFM. I love JSON, it’s totally awesome and the fact that you can not convert CF objects natively is even better! I ran into a small issue where I was using serializeJSON on a structure that contained a query object (don’t ask!). The problem was when the serialized string was deserialized using deserializeJSON the query was no longer a query, it was not a structure! It turns out that the serializeJSON function takes two parameters!
The second optional parameter serializeQueryByColumns tells CF to handle queries in a special way. Now the trick is to remember to use the second parameter of the DeserializeJSON function which performs the reverse operation. The second parameter must be set to false for the query object to be recreated during deserialization.
Here are links to the serializeJSON and deserializeJSON in LiveDocs.
Related Posts