[CXX-2078] Unable to find bsonobj.h Created: 18/Jul/20  Updated: 27/Oct/23  Resolved: 20/Jul/20

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Eugene Rockley Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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;



 Comments   
Comment by Alexander Golin (Inactive) [ 20/Jul/20 ]

Hi Eugene, thanks for your ticket submission - it appears you have figured out the issue you were having so we are closing this ticket. Please let us know if you end up suspecting a bug!

Comment by Eugene Rockley [ 18/Jul/20 ]

Turns out it merged to 
bsoncxx::from_json()
Got it worked. 

Generated at Wed Feb 07 22:04:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.