mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-18 17:27:11 +00:00
foreachByFilter feature
This commit is contained in:
@ -382,3 +382,12 @@ struct DBQuery : NonCopyable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline void foreachByFilter(lmdb::txn &txn, const tao::json::value &filter, std::function<void(uint64_t, std::string_view)> cb) {
|
||||||
|
DBQuery query(filter);
|
||||||
|
|
||||||
|
query.process(txn, [&](const auto &, uint64_t levId, std::string_view eventPayload){
|
||||||
|
cb(levId, eventPayload);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user