Skip to main content

Get

Retrieves a value from the database by its key.

  • Parameters:
    • key: The key to look up.
  • Returns:
    • The result of the operation, includes a boolean indicating whether the operation was successful and the value, or an error if the operation failed.
const result = db.get<User>("user:1234");
if (result.success) {
console.log(`User: ${result.data.name}`);
} else {
console.log(result.error.message);
}