【发布时间】:2023-02-07 11:10:15
【问题描述】:
我需要遍历 RocksDB 中的所有键值以填充我的 POD 集合。我不需要在检索后存储键值。我应该使用什么 - DeleteRange() 循环后或 Delete() 循环内?如果是DeleteRange(),那么必须传递什么结束迭代器作为参数?
QScopedPointer<Iterator> it(m_db->NewIterator(ReadOptions()));
for (it->SeekToFirst(); it->Valid(); it->Next())
{
// filling POD collection
}
【问题讨论】:
-
DeleteRange采用一对迭代器 - “从”和“到”位置,并删除其间的所有内容。你的问题到底是什么? -
“to”应该用什么?
it->SeekToLast()->Next()?
标签: c++ database key-value rocksdb