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

SaveOrUpdate #34

Closed
dbgjerez opened this issue Apr 22, 2022 · 2 comments · Fixed by #36
Closed

SaveOrUpdate #34

dbgjerez opened this issue Apr 22, 2022 · 2 comments · Fixed by #36
Assignees
Labels
enhancement New feature or request

Comments

@dbgjerez
Copy link
Contributor

clover/db.go

Line 63 in 530c209

objectId := newObjectId()

Hi,

I'm not sure if this is an issue or discussion. I'm very happy with this database and I like to help it if I can.

Some databases have a function to update or save a new document. In this case, the database is always creating a new document.

I think that if the document ID is provided by the user, it is easier to omit this line and update the document.

What do you think about?, if you are agreed, I can modify it or create a new function and I will do a PR.

Thanks a lot

@ostafen
Copy link
Owner

ostafen commented Apr 22, 2022

Hi, @dbgjerez, thank you for your suggestion. I agree with this feature, and your contribution would be welcome.
I think it is better to call the new function Save() instead of SaveOrUpdate().
I assigned the issue to you :=)

EDIT: if you want, also join our gitter channel for discussing about further features and improvements ;=)

@ostafen ostafen added the enhancement New feature or request label Apr 22, 2022
@dbgjerez
Copy link
Contributor Author

Hi, ok I will call it Save().
I have just joined the gitter channel ;)
Thanks!

@ostafen ostafen linked a pull request Apr 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants