⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
▼
userver
Documentation
►
API Groups
►
Namespaces
▼
Reference
►
Namespace Members
►
Class List
Class Index
►
Class Hierarchy
►
Class Members
▼
File List
►
en
►
testsuite
►
userver
►
userver
►
userver
►
userver
►
userver
▼
userver
►
cache
►
formats
▼
storages
▼
mongo
►
bulk.hpp
►
bulk_ops.hpp
►
collection.hpp
component.hpp
►
cursor.hpp
dist_lock_component_base.hpp
dist_lock_strategy.hpp
►
exception.hpp
mongo_error.hpp
multi_mongo.hpp
►
operations.hpp
►
options.hpp
pool.hpp
►
pool_config.hpp
write_result.hpp
mongo.hpp
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
write_result.hpp
1
#
pragma
once
2
3
#
include
<
cstddef
>
4
#
include
<
optional
>
5
#
include
<
unordered_map
>
6
#
include
<
vector
>
7
8
#
include
<
userver
/
formats
/
bson
/
document
.
hpp
>
9
#
include
<
userver
/
formats
/
bson
/
value
.
hpp
>
10
#
include
<
userver
/
storages
/
mongo
/
mongo_error
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
storages
::mongo {
15
16
/// MongoDB write operation result
17
class
WriteResult
{
18
public
:
19
/// Creates an empty write result
20
WriteResult
() =
default
;
21
22
/// @cond
23
/// Wraps provided write result, internal use only
24
explicit
WriteResult(formats::
bson
::
Document
);
25
/// @endcond
26
27
/// @name Affected document counters
28
/// Valid only for acknowledged writes, i.e. non-zero write concern
29
/// @{
30
size_t InsertedCount()
const
;
31
size_t MatchedCount()
const
;
32
size_t ModifiedCount()
const
;
33
size_t UpsertedCount()
const
;
34
size_t DeletedCount()
const
;
35
/// @}
36
37
/// Map of `_id` values of upserted documents by operation (document) index
38
std
::
unordered_map
<
size_t
,
formats
::
bson
::
Value
>
UpsertedIds
()
const
;
39
40
/// The document returned by FindAnd* operation if any
41
std::optional<formats::
bson
::
Document
>
FoundDocument
()
const
;
42
43
/// @brief Map of server errors by operation (document) index.
44
///
45
/// For example, storages::mongo::Collection::InsertMany() with
46
/// storages::mongo::options::Unordered and
47
/// storages::mongo::options::SuppressServerExceptions option would produce a
48
/// WriteResult with WriteResult::ServerErrors() containing information about
49
/// failed insertions.
50
///
51
/// @see options::SuppressServerExceptions
52
std
::
unordered_map
<
size_t
,
MongoError
>
ServerErrors
()
const
;
53
54
/// @brief Write concern errors
55
/// @see options::SuppressServerExceptions
56
std
::
vector
<
MongoError
>
WriteConcernErrors
()
const
;
57
58
private
:
59
formats::
bson
::
Document
value_;
60
};
61
62
}
// namespace storages::mongo
63
64
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
storages
mongo
write_result.hpp
Generated on Wed May 15 2024 22:27:40 for userver by
Doxygen
1.10.0