Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

SET opcode #50

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

threshold862543
Copy link

@threshold862543 threshold862543 commented Aug 28, 2022

This implements an SET opcode for docstores.
You specify a key, and edit parameters, so you can update certain values of a document. This could be useful for example if you have a document with many fields and you want to make a small change or toggle a setting without having to re-obtain and re-input all of the values in the whole document.

Usage:
await mydocstore.set(key, {"title": "new title", "setting": true})

This removes the handled checking for going backwards, and checks through the oplog from oldest to newest, so I'm curious if people think that's a good idea or not.
Also implements the changes in #48, apart from those relating to the above.

EDIT opcode to overwrite specific values
remove unneeded line
change arg order
Allow new fields/not checking if the field exists. It should be faster and more flexible this way.
proper ordering of edits
Change opcode name to SET
@threshold862543 threshold862543 changed the title EDIT opcode SET opcode Aug 28, 2022
@threshold862543 threshold862543 marked this pull request as ready for review August 28, 2022 19:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant