Ditto  1.0.14
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...

Public Member Functions

 Document (const Document &)=delete
 
 Document (Document &&) noexcept
 
DocumentId id ()
 Get the ID of the document. More...
 
nlohmann::json value () const
 Get the document's inner value. More...
 
DocumentPath operator[] (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. More...
 

Detailed Description

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

Member Function Documentation

◆ id()

DocumentId ditto::Document::id ( )

Get the ID of the document.

Returns
the document's ID.

◆ operator[]()

DocumentPath ditto::Document::operator[] ( 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.