Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2078

Unable to find bsonobj.h

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • C++
      Windows

    Description

      I'm trying to convert a JSON string to Bson Object.

       

      From Stackoverflow answers, I found that I can use like this,

       
          mongo::BSONObj object = mongo::fromjson("name: 'hi'");
       
      But, VS code display that both mongo and BSON as undefined. 
       
      This is what I have included

      #include <bsoncxx/builder/stream/document.hpp>
      #include <bsoncxx/json.hpp>
      #include <mongocxx/client.hpp>
      #include <mongocxx/stdx.hpp>
      #include <mongocxx/uri.hpp>
      #include <mongocxx/instance.hpp>

      using bsoncxx::builder::stream::close_array;
      using bsoncxx::builder::stream::close_document;
      using bsoncxx::builder::stream::document;
      using bsoncxx::builder::stream::finalize;
      using bsoncxx::builder::stream::open_array;
      using bsoncxx::builder::stream::open_document;

      Attachments

        Activity

          People

            Unassigned Unassigned
            eugenerockley@gmail.com Eugene Rockley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: