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

Append-only means no row delete? #7

Closed
nielsbom opened this issue Jan 25, 2021 · 4 comments
Closed

Append-only means no row delete? #7

nielsbom opened this issue Jan 25, 2021 · 4 comments

Comments

@nielsbom
Copy link

I like jsdb! So thanks :-)

I couldn't find in the docs or source how to delete a row in an array/table. Is that a feature or am I looking in the wrong place? I see updating works but I'm not sure how to delete a row.

I could resort to deleting the table and replacing it with the table-without-that-row but that seems brutish :-)

Thanks again!

@aral
Copy link
Contributor

aral commented Jan 25, 2021

Hi there,

You’re welcome; happy you like it :)

To delete from an array, just use the regular array methods (pop, splice, etc.) Note that splicing can be slow (to see what it does, perform it and then cat your database table in terminal and see exactly how it works.

@nielsbom
Copy link
Author

Ah that clears it up. Thanks!

@nielsbom
Copy link
Author

I created a doc-PR, seems helpful.
#8

@aral
Copy link
Contributor

aral commented Feb 2, 2021

Thank you, appreciate it. Will merge first chance I get :)

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