#1 Re: Other components » SynMongoDB float with quote problem » 2017-08-18 12:13:01

i create a TDocVariant from json :

doc := TDocVariant.NewJSON(aContent,[dvoValueCopiedByReference]);

i have added dvoAllowDoubleValue
doc := TDocVariant.NewJSON(aContent,[dvoValueCopiedByReference,dvoAllowDoubleValue]);
and it is now ok

I have searched in the source code of synCommons.pas but  this option has escaped my view

Thanks a lot

#2 Other components » SynMongoDB float with quote problem » 2017-08-18 09:46:37

Hector
Replies: 3

Hi,

i am using synmongoDB with good results.
but i have a problem with double :
quotes are added to json and if i create  an index on the geoson structure i have an error message : point must only contain numeric elements

"location":{"type":"Point","coordinates":["2.12454","48.12475"]}

if the double value have 4 or less decimals it is ok :

"location":{"type":"Point","coordinates":[2.1245,48.1247]}

the json send to mongodb is ok but the json in the database is wrong.

Do you have an idea to find a solution to this problem ?

Thanks by advance

Board footer

Powered by FluxBB