Hi
How could I get all the keys in a box and change all of them to a specific value?
if I want to delete all keys in a box, better to delete the box or find each key and delete it?
how could I delete or empty a box?
1) box.keys. You cannot change a key, you have to delete / add
2) box.deleteFromDisk()
@MoacirSchmidt
Thanks, Will be very good if these added to Docs
Q: how could I convert _KeyIterable
I use This
List<String> dbKeys = [];
box.keys.toString().replaceAll(new RegExp(r"([() ]+)"), '').split(',').forEach((key) {
dbKeys.add(key);
});
if I want to delete all keys in a box, better to delete the box or find each key and delete it?
You should use box.clear().
how could I convert _KeyIterable
to a List
box.keys returns an Iterable<dynamic>. If you want this iterable to be a list, just use box.keys.toList().