20#include <nlohmann/json.hpp>
164 std::chrono::milliseconds
load_next(nlohmann::
json &out, std::
string &collection_name);
175 std::unique_ptr<Impl> _impl;
Replay reader over one or more MongoDB collections.
MongoFetch(MongoFetch &&) noexcept
void set_unwrap_original(bool unwrap)
Set whether to unwrap the original document.
MongoFetch(const MongoFetch &)=delete
void select_database(const std::string &db_name)
Select the database on which to operate.
std::size_t fetch_data_from(const std::string &view_name)
Reuse an existing persistent replay view.
void set_repeat(bool repeat)
Set whether replay restarts from the beginning after the last record.
MongoFetch & operator=(const MongoFetch &)=delete
void disconnect()
Close the connection to the MongoDB server and clear replay state.
~MongoFetch()
Destroy the fetcher instance.
MongoFetch(const std::string &uri)
Construct a fetcher bound to the specified MongoDB URI.
std::size_t fetch_data()
Create a replay view over the selected MongoDB data.
std::chrono::milliseconds load_next(nlohmann::json &out, std::string &collection_name)
Load the next record from the replay view.
void select_time_range(const std::string &start, const std::string &end)
Select the time range of interest.
void select_collections(const std::vector< std::string > &collections)
Define the list of collections to fetch data from.
void connect()
Open the connection to the MongoDB server.