Ditto 4.5.3
Loading...
Searching...
No Matches
Static Public Member Functions | Public Attributes | List of all members
ditto::LiveQueryEvent Class Reference

The events that you receive when dealing with live queries. More...

#include <LiveQueryEvent.hpp>

Static Public Member Functions

static uint64_t hash (std::vector< Document > const &documents)
 Returns a hash that represents the set of matching documents.
 
static std::string hash_mnemonic (std::vector< Document > const &documents)
 Returns a pattern of words that together create a mnemonic, which represents the set of matching documents.
 

Public Attributes

bool is_initial
 Returns whether or not this is the initial event for the associated live query.
 
std::vector< Documentold_documents
 A list of all of the documents that matched the live query as part of the previous update.
 
std::vector< std::size_t > insertions
 A list of the indexes in the list of new matching documents at which new matching documents have been inserted.
 
std::vector< std::size_t > deletions
 A list of the indexes in the list of old matching documents at which previously matching documents have been removed.
 
std::vector< std::size_t > updates
 A list of the indexes in the list of new matching documents at which already matching documents have been updated.
 
std::vector< LiveQueryMovemoves
 A list of the move objects that provide the indexes, in relation to the list of old matching documents, that already matching documents have moved from and the indexes, in relation to the list of new matching documents, that the documents have moved to.
 

Detailed Description

The events that you receive when dealing with live queries.

Member Function Documentation

◆ hash()

uint64_t ditto::LiveQueryEvent::hash ( std::vector< Document > const & documents)
static

Returns a hash that represents the set of matching documents.

Parameters
[in]documentsthe matching documents delivered alongside the live query event.
Returns
a hash that represents the set of matching documents.

◆ hash_mnemonic()

std::string ditto::LiveQueryEvent::hash_mnemonic ( std::vector< Document > const & documents)
static

Returns a pattern of words that together create a mnemonic, which represents the set of matching documents.

Parameters
[in]documentsthe matching documents delivered alongside the live query event.
Returns
a pattern of words that together create a mnemonic, which represents the set of matching documents.

Member Data Documentation

◆ is_initial

bool ditto::LiveQueryEvent::is_initial

Returns whether or not this is the initial event for the associated live query.

This will only be true for the first event delivered for a given live query.