12#include <userver/formats/bson/document.hpp>
13#include <userver/formats/bson/iterator.hpp>
14#include <userver/formats/bson/types.hpp>
15#include <userver/formats/bson/value.hpp>
16#include <userver/formats/common/meta.hpp>
17#include <userver/formats/common/transfer_tag.hpp>
18#include <userver/formats/common/type.hpp>
19#include <userver/utils/strong_typedef.hpp>
21USERVER_NAMESPACE_BEGIN
23namespace formats::
bson {
57 explicit ValueBuilder(impl::ValueImplPtr);
72 ValueBuilder(
Value&&);
79 ValueBuilder(std::nullptr_t);
82 ValueBuilder(
unsigned int);
84 ValueBuilder(
unsigned long);
85 ValueBuilder(
long long);
86 ValueBuilder(
unsigned long long);
88 ValueBuilder(
const char*);
89 ValueBuilder(std::string);
90 ValueBuilder(std::string_view);
91 ValueBuilder(
const std::chrono::system_clock::time_point&);
92 ValueBuilder(
const Oid&);
101 template <
typename T>
118 const utils::StrongTypedef<Tag, std::string, Ops>& name);
194 void Assign(
const impl::ValueImplPtr&);
195 void Assign(impl::ValueImplPtr&&);
197 template <
typename T>
198 static Value DoSerialize(
const T& t);
200 impl::ValueImplPtr impl_;
205 const utils::StrongTypedef<Tag, std::string, Ops>& name) {
206 return (*
this)[name.GetUnderlying()];
213 "There is no `Serialize(const T&, formats::serialize::To<bson::Value>)` "
214 "in namespace of `T` or `formats::serialize`. "
216 "Probably you forgot to include the "
217 "<userver/formats/serialize/common_containers.hpp> or you "
218 "have not provided a `Serialize` function overload.");
220 return Serialize(t, formats::serialize::To<Value>());