docudb
1.0
|
Represents a database document. More...
#include <docudb.hpp>
Public Member Functions | |
std::string | id () const |
Gets the document ID. | |
std::string | body () const |
Gets the full body of the document. | |
db_document & | body (std::string_view body) |
Sets the full body of the document. | |
db_document & | replace (std::string_view query, std::float_t value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::double_t value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::int32_t value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::int64_t value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::nullptr_t value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::string const &value) |
Replace a value in the json body. | |
db_document & | replace (std::string_view query, std::string_view value) |
Replace a value in the json body. | |
db_document & | set (std::string_view query, std::float_t value) |
db_document & | set (std::string_view query, std::double_t value) |
db_document & | set (std::string_view query, std::int32_t value) |
db_document & | set (std::string_view query, std::int64_t value) |
db_document & | set (std::string_view query, std::nullptr_t value) |
db_document & | set (std::string_view query, std::string const &value) |
db_document & | set (std::string_view query, std::string_view value) |
db_document & | insert (std::string_view query, std::float_t value) |
db_document & | insert (std::string_view query, std::double_t value) |
db_document & | insert (std::string_view query, std::int32_t value) |
db_document & | insert (std::string_view query, std::int64_t value) |
db_document & | insert (std::string_view query, std::nullptr_t value) |
db_document & | insert (std::string_view query, std::string const &value) |
db_document & | insert (std::string_view query, std::string_view value) |
db_document & | patch (std::string_view json) |
Patches the JSON body of the document. | |
std::string | get_string (std::string_view query) const |
std::int64_t | get_number (std::string_view query) const |
std::double_t | get_real (std::string_view query) const |
json_type | get_type (std::string_view query) const |
std::size_t | get_array_length (std::string_view query) const |
std::vector< std::string > | get_object_keys (std::string_view query) const |
template<typename... Types> | |
std::tuple< Types... > | get (const std::vector< std::string > &fields) const |
void | erase () |
Removes the document from the collection. | |
Friends | |
struct | db_collection |
struct | db_document_ref |
Represents a database document.
Definition at line 562 of file docudb.hpp.
std::string docudb::db_document::body | ( | ) | const |
Gets the full body of the document.
db_document & docudb::db_document::body | ( | std::string_view | body | ) |
Sets the full body of the document.
body | The new body content. |
void docudb::db_document::erase | ( | ) |
Removes the document from the collection.
|
inline |
Definition at line 695 of file docudb.hpp.
std::size_t docudb::db_document::get_array_length | ( | std::string_view | query | ) | const |
std::int64_t docudb::db_document::get_number | ( | std::string_view | query | ) | const |
std::vector< std::string > docudb::db_document::get_object_keys | ( | std::string_view | query | ) | const |
std::double_t docudb::db_document::get_real | ( | std::string_view | query | ) | const |
std::string docudb::db_document::get_string | ( | std::string_view | query | ) | const |
json_type docudb::db_document::get_type | ( | std::string_view | query | ) | const |
std::string docudb::db_document::id | ( | ) | const |
Gets the document ID.
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::double_t | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::float_t | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::int32_t | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::int64_t | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::nullptr_t | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::string const & | value ) |
db_document & docudb::db_document::insert | ( | std::string_view | query, |
std::string_view | value ) |
db_document & docudb::db_document::patch | ( | std::string_view | json | ) |
Patches the JSON body of the document.
json | The JSON patch. |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::double_t | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::float_t | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::int32_t | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::int64_t | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::nullptr_t | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::string const & | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::replace | ( | std::string_view | query, |
std::string_view | value ) |
Replace a value in the json body.
query | The query that points to the value to replace. |
value | The new value |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::double_t | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::float_t | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::int32_t | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::int64_t | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::nullptr_t | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::string const & | value ) |
db_document & docudb::db_document::set | ( | std::string_view | query, |
std::string_view | value ) |
|
friend |
Definition at line 726 of file docudb.hpp.
|
friend |
Definition at line 727 of file docudb.hpp.