intridea/multi_json — Issue #29: NaN support broken in more recent version of multi_json
Author: mwawrusch
Created: 2011-10-17 11:14:17+00:00
State: open

NaN is not part of the json standard, but it was emitted by some json libs, probably even multi_json. It was also parsed through multi_json but not any more.

Here is an example:

{"ns":"scottyapp.test","count":0,"size":0,"avgObjSize":NaN,"storageSize":8192,"numExtents":1,"nindexes":1,"lastExtentSize":8192,"paddingFactor":1.0,"flags":1,"totalIndexSize":8192,"indexSizes":{"_id_":8192},"ok":1.0}

Which results in

MultiJson::DecodeError:
196: unexpected token at 'NaN,"storageSize":8192,"numExtents":1,"nindexes":1,"lastExtentSize":8192,"paddingFactor":1.0,"flags":1,"totalIndexSize":8192,"indexSizes":{"_id_":8192},"ok":1.0}'

Not sure if this is something that should be fixed or not, just wanted to raise the issue here.