Ditto 1.1.3
Public Member Functions | List of all members
ditto::MutableDocument Class Reference

This is used as part of update operations for documents. More...

#include <MutableDocument.hpp>

Public Member Functions

 MutableDocument (const MutableDocument &other)=delete
 
 MutableDocument (MutableDocument &&other)=default
 
MutableDocumentPath operator[] (const std::string &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 or perform an update operation on it immediately. More...
 

Detailed Description

This is used as part of update operations for documents.

It provides access to updating a document through a subscript-based API. A subscript operation returns a MutableDocumentPath that you can then use to chain further subscript operations to in order to access nested values in a document.

Once you've defined the path to a key in a document that you'd like to update, by using subscripts, then you can use the functionality defined on MutableDocumentPath to perform the desired document update(s).

Note that objects of this type should only be used within the scope of the update lambda that they are provided in.

Member Function Documentation

◆ operator[]()

MutableDocumentPath ditto::MutableDocument::operator[] ( const std::string &  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 or perform an update operation on it immediately.

Parameters
[in]paththe initial part of the path needed to get to the key in the document you wish to update.