bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 166 forks source link

Unknown Error #164

Closed talha-asad closed 10 years ago

talha-asad commented 10 years ago

Hi,

Thanks for the great work you've done on this application. I found an issue, it prevents me to see any data in one of my collections.

I am using the latest version i.e 2.3.10

I see one request returning 500 error in the network tab of chrome and the response of that request is below.

500: PHP warning:  json_encode(): double NAN does not conform to the JSON spec, encoded as 0

The data in the collection i am trying to view was added by a third party application. I don't understand if mongo is okay with the json in the collection, why is PHP not happy with it ?

bobthecow commented 10 years ago

That error is just what it sounds like. Mongo is just fine with storing NaN, but it's not allowed in JSON which means you can't json_encode a Mongo document with NaN in it. There is a workaround for this in the upcoming 3.0 release (see #115) but that is still a little way away.

talha-asad commented 10 years ago

Okay, thanks for the elaborate response @bobthecow Will wait for v3 :)

bobthecow commented 10 years ago

No worries :)

9point6 commented 10 years ago

Related - there is a similar issue with Infinity (and -Infinity) not being allowed in JSON.

bobthecow commented 10 years ago

@9point6 Good catch. Do you mind opening an issue for that one as well?