Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Simple key-value lookup #253

Open
tacman opened this issue Feb 18, 2023 · 1 comment
Open

[Feature Request] Simple key-value lookup #253

tacman opened this issue Feb 18, 2023 · 1 comment

Comments

@tacman
Copy link

tacman commented Feb 18, 2023

Great project, thanks for creating and sharing it.

My needs are pretty simple, I want a portable key/value lookup. I realize I can do this with sleek db already, but I'm wondering if there's an even more elegant way.

My psuedo-code for a web scraper, based on the way the Symfony cache interface works:

$url = 'http....';
$_id = md5($urll);
if (!$data = $store->findById($_id)) {
    $data['html'] = file_get_contents($url);
    $data['_id'] = $_id; 
    $store->insert($data);
}

Obviously, I can use a key and do a FindOneBy, but it seems like the experience would be optimized if the user can set their own key.

@Timu57
Copy link
Member

Timu57 commented May 15, 2023

Hi @tacman to ensure compatibility with SleekDB v1 we decided to not lift that restriction for now. Setting your own ID is a frequently requested feature. We will implement that with the next major update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants