diff --git a/src/DBQuery.h b/src/DBQuery.h index 6a76d03..e4cbdfe 100644 --- a/src/DBQuery.h +++ b/src/DBQuery.h @@ -382,3 +382,12 @@ struct DBQuery : NonCopyable { return true; } }; + + +inline void foreachByFilter(lmdb::txn &txn, const tao::json::value &filter, std::function cb) { + DBQuery query(filter); + + query.process(txn, [&](const auto &, uint64_t levId, std::string_view eventPayload){ + cb(levId, eventPayload); + }); +}