Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
ubuntu 16.04 x86_64, mongocxxdriver master branch.
*Location*: https://docs.mongodb.com/getting-started/cpp/insert/
*User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36
*Referrer*: https://docs.mongodb.com/getting-started/cpp/client/
*Screen Resolution*: 1920 x 1080
ubuntu 16.04 x86_64, mongocxxdriver master branch. *Location*: https://docs.mongodb.com/getting-started/cpp/insert/ *User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 *Referrer*: https://docs.mongodb.com/getting-started/cpp/client/ *Screen Resolution*: 1920 x 1080
Description
Problem with:
bsoncxx::document::value restaurant_doc =
document{} << "address" << open_document << "street" ....
Compiler reports error:
test1.cpp:46:30: error: conversion from ‘std::enable_if<true, bsoncxx::v_noabi::document::value>::type
{aka bsoncxx::v_noabi::document::value}’ to non-scalar type ‘bsoncxx::v_noabi::builder::stream::document’ requested
<< "41704620" << finalize;
Fixed by not doing the initial assignment. E.g not mentioning document{}.
bsoncxx::document::value restaurant_doc{};
restaurant_doc << "address" << ...