Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

Coldfusion 11 & serializedJSON issue

$
0
0

Hi

 

I wanted to upgrade our Coldfusion 10 to 11. We are using MongoDB as additional database, so we use Java MongoDB driver. And until this point everything is fine & everything works.

 

All data to Mongo and from Mongo are in JSON format. Problem we have is that serialization changed in CF 11 what broke all queries.

Here is an example:

CF10: { "VAL1" : 0 , "VAL2" : { "$ne" : false} , "VAL3" : true , "VAL4" : { "$gt" : 5}}

CF11: { "VAL1" : "0" , "VAL2" : { "$ne" : "false"} , "VAL3" : "true" , "VAL4" : { "$gt" : "5"}}

Problem is that 0 != "0", true != "true", 5 != "5". Mongo can't compare string with int or bool (same issue with floats)

 

When i put data to database have same issue. Something that was before integer or bool now is string.

 

I found a way to make it work Javacast('int',value), Javacast('boolean',value) but changing it in every place in big project will take far too much time. Is there a way to make SerializeJson work like it worked before? Why it changes types now?


Viewing all articles
Browse latest Browse all 5979

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>