[CXX-1786] Document stream is not available Created: 12/Jun/19  Updated: 16/Oct/21  Resolved: 23/Sep/19

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

Type: Task Priority: Major - P3
Reporter: sphinxs Assignee: Samantha Ritter (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Mint 19.1 - XFCE



 Description   

I have installed Mongo CXX driver and added the following headers in my application:

```cpp
#include <bsoncxx/json.hpp>

#include <mongocxx/stdx.hpp>
```
 
When I try to create a document using `bsoncxx::builder::stream`, I receive the following error:
 
```sh
error: ‘bsoncxx::v_noabi::builder::stream’ has not been declared
```
 
If I open the code in /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp , only the basic is available:
 
```cpp
#pragma once

#include <bsoncxx/builder/concatenate.hpp>

#include <bsoncxx/config/prelude.hpp>

namespace bsoncxx {

BSONCXX_INLINE_NAMESPACE_BEGIN

namespace builder {

namespace basic

{ using bsoncxx::builder::concatenate; }

// namespace basic

} // namespace builder

BSONCXX_INLINE_NAMESPACE_END

} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>
```
 
Am I importing from the wrong place, or is a error in this version / I made the installation of a wrong way ? How can I fix this and use the stream (for documents that has binary field(s), is it the basic recommended ?)



 Comments   
Comment by sphinxs [ 29/Sep/19 ]

Hi @Samantha. I had already fixed this in my project, thanks for the reply ( :

Comment by Samantha Ritter (Inactive) [ 23/Sep/19 ]

Hi sphinxs,

Thank you for your ticket. I realize it's been a while since you filed this, but are you still having this issue? The stream builder and the basic builder are defined in separate headers. You should see the stream builder convenience methods in bsoncxx/builder/stream/helpers.hpp. To use the stream builder in your code, include the following header files:

#include <bsoncxx/builder/stream/helpers.hpp>
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/builder/stream/array.hpp>

I'm going to resolve this issue, but if you continue to have problems with your application, please feel free to open a new ticket.

Thanks!
Samantha Ritter

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