|
Hi!
I have just tried this out, with the following code:
#include <iostream>
|
|
#include <bsoncxx/json.hpp>
|
|
int main(int, char**) {
|
constexpr auto k_valid_json = R"({ "a" : 1, "b" : 2.2556 })";
|
|
const auto actual = bsoncxx::from_json(k_valid_json);
|
const auto actual_view = actual.view();
|
|
std::cout << bsoncxx::to_json(actual_view) << std::endl;
|
}
|
and compiled with:
$ g++ -std=c++11 -o cxx1449 cxx1449.cpp `pkg-config --cflags --libs libmongocxx`
|
When I run it, I get the following (expected) output:
$ ./cxx1449
|
{ "a" : 1, "b" : 2.2555999999999998273 }
|
Can you let us know:
- what your libmongoc version you use is?
- what your libbson version you use it?
- which mongocxx version are you are using?
- what your locale is (echo $LANG)?
- which platform you are on?
- which compiler version you are using?
|
|
Hi,
could you share some more code? For example, how you go from the
R"({ "a" : 1, "b" : 2.2556 })
|
to the result that you get. Did you insert, and then query the data, or something else?
cheers,
Derick
|