Disable $ numberLong for 64-bit int values ​​when converting BSON to JSON

I am using the BSON mongodb C ++ library. I recently updated to use mongodb 3.0, and now BSON serialization with 64 bit ints gives:

{"time": {"$numberLong": "123"}} 

when i call it:

 BSON("time" << time).jsonString() 

My client code cannot handle this and needs json instead:

 {"time": 123} 

How do I get the old mongodb 2.4 behavior?

+7
c ++ json mongodb
source share

No one has answered this question yet.

See related questions:

1455
The easiest way to convert int to string in C ++
1349
Why can't Python parse this JSON data?
1186
Convert JS object to JSON string
658
What is the difference between YAML and JSON?
583
How can I print a circular structure in a JSON-like format?
326
Convert Array to JSON
260
How to convert int to QString?
2
Mongo Document JSON & # 8594; JSON & # 8594; BSON
one
BSON cannot serialize BigDecimal
0
How to convert from BSON to JSON directly in Python?

All Articles