I\'m using the mongo-cxx-driver-r3.1.1 based on mongo-c-driver-1.6.2. Using the latest examples provided on github, I managed to find how to connect the database and how to save
Your code looks right, as you included all necessary header files needed for make_document
and make_array
.
You said in your comment, that the document.hpp doesn't contain the make_document
and the array.hpp doesn't contain the make_array
template.
This is right for the release mongo-cxx-driver-r3.1.1
.
In the current master branch the header files exists as you can see if you follow the source links for them: document.hpp and array.hpp. The examples you use are probably for the new master branch as they are also from a current branch from git.