classic-level icon indicating copy to clipboard operation
classic-level copied to clipboard

When snapshot is created with `db.get()`

Open anseki opened this issue 3 years ago • 0 comments

Hi, thank you for the great library.

I have a question about the document for snapshot with db.get(). https://github.com/Level/classic-level#dbgetkey-options-callback

The document said, the snapshot is created at the time db.get() was called. I thought, this means that the snapshot is latest data for this calling. However, the document also said, it should not see the data of simultaneous write operations.

Can the data be changed after db.get() was called (and the snapshot was created) and before db.get() returns the data? That is, I understand that an iterator might return old data because that reads lazily it, but db.get() is not. Then I thought that db.get() returns latest data before something changes it. Or, is there a way to get latest data?

Thank you.

anseki avatar Apr 07 '22 03:04 anseki