MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
insert_one.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
18
20#include <bsoncxx/types.hpp>
22
24
26
27namespace mongocxx {
28namespace v_noabi {
29namespace result {
30
34class insert_one {
35 public:
36 // This constructor is public for testing purposes only
39
46
53
54 friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(insert_one const&, insert_one const&);
55 friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator!=(insert_one const&, insert_one const&);
56
57 private:
58 result::bulk_write _result;
59
60 // Array with a single element, containing the value of the _id field for the inserted document.
61 bsoncxx::v_noabi::array::value _inserted_id_owned;
62
63 // Points into _inserted_id_owned.
65};
66
67} // namespace result
68} // namespace v_noabi
69} // namespace mongocxx
70
72
Provides bsoncxx::v_noabi::array::value.
A read-only BSON array that owns its underlying buffer.
Definition value.hpp:37
A non-owning variant that can contain any BSON type.
Definition view.hpp:55
bsoncxx::v_noabi::types::bson_value::view const & inserted_id() const
Gets the _id of the inserted document.
result::bulk_write const & result() const
Returns the bulk write result for this insert operation.
The result of a MongoDB bulk write operation.
Definition bulk_write.hpp:36
bsoncxx::v_noabi::types::bson_value::view const & inserted_id() const
Gets the _id of the inserted document.
result::bulk_write const & result() const
Returns the bulk write result for this insert operation.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
Declares entities representing the result of various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v_noabi::result::bulk_write.
Declares mongocxx::v_noabi::result::insert_one.
Provides bsoncxx::v_noabi::types::bson_value::view.
Provides entities used to represent BSON types.