Reputation: 970
I have a data structure which contains an object with fields with numerical names, e.g.
{1 : {views:42, impressions:999}, 2 : {...} ...}
This is not an 'array', just an identifiers. When I request those records via PHP Mongo extension 1.4.4 (both mongo 2.4.7 and web server are running on Win7) I receive those keys as expected, i.e.
2
impressions 9
views 0
3
impressions 9
views 9
1
impressions 50
views 50
But when this code runs in staging environment (LAMP, where we have mongo driver 1.6.0-dev, mongodb itself is 2.4.2) I receive them this weird way:
NumberLong(2)
impressions 9
views 0
NumberLong(3)
impressions 9
views 9
NumberLong(1)
impressions 50
views 50
where 'NumberLong(X)' is plain string, coming right from my cursor. It's not a big deal to fix this and replace numerical names with string ones, but I'm wondering what driver (or DB) behaves wrong and why.
Both servers have 'mongo.native_long' enabled.
Upvotes: 0
Views: 887
Reputation: 43884
It behaves like this because of how it is setup: http://www.php.net/manual/en/mongo.configuration.php
The setting you are looking for is: http://www.php.net/manual/en/mongo.configuration.php#ini.mongo.native-long
Upvotes: 2