Ditto 4.4.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ditto::Document Class Reference

A document belonging to a Collection with an inner value and an identifier (DocumentId). More...

#include <Document.hpp>

Public Member Functions

 Document (const Document &)=delete
 
 Document (Document &&) noexcept
 
DocumentId id () const
 Get the ID of the document.
 
nlohmann::json value () const
 Get the document's inner value.
 
DocumentPath operator[] (const std::string initial_path)
 Used to specify a path to a key in the document that you can subscript further to access a nested key in the document.
 

Detailed Description

A document belonging to a Collection with an inner value and an identifier (DocumentId).

Member Function Documentation

◆ id()

DocumentId ditto::Document::id ( ) const

Get the ID of the document.

Returns
the document's ID.

◆ operator[]()

DocumentPath ditto::Document::operator[] ( const std::string  initial_path)

Used to specify a path to a key in the document that you can subscript further to access a nested key in the document.

Parameters
[in]initial_pathThe initial part of the path needed to get to the key in the document you wish to get the value of.
Returns
a DocumentPath object with the provided key incorporated into the document path.

◆ value()

json ditto::Document::value ( ) const

Get the document's inner value.

Returns
the document's inner value.