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

add document entry #116

Open
snapo opened this issue Aug 9, 2016 · 1 comment
Open

add document entry #116

snapo opened this issue Aug 9, 2016 · 1 comment

Comments

@snapo
Copy link

snapo commented Aug 9, 2016

Hi ,
First many thanks for creating this go project, im also getting in to golang and did just wanna take a look on your nosql server.
Im in the following problem while testing the server (probably my error).
I did not found a way to add an entry to a existing document...

  1. create?col=123
  2. '{"a": 1, "b": 2}' insert?col=123

now i need to add c3 so my steps are

  1. query?q=123 (so i get the document ID)
  2. get?col=Feeds&id=123123123123123123123
  3. Save response in memory (on local computer)
  4. add additional key/value in memory (on local computer)
  5. '{"a": 1, "b": 2, "c": 3}' update?col=Feeds&id=123123123123123

Because its my first document DB i would like to ask if this way is correct, or is there a shorter way like:
'{"c": 3}' addvalueallifnotexist?col=123
'{"c": 3}' addvaluealloverwriteifexist?col=123

i am asking this because i have only 1 document per collection and the documents are kind big.
currently there is not so much traffic and concurrent sessions... but in the future it could really have a impact :-(

If im doing all wrong, then you can close the case, otherwise its a feature request. (yes im using your DB as a key/value store)

Best regards
And many thanks for developing such a great Server

@HouzuoGuo
Copy link
Owner

Appreciate your feedback, and the procedure you described is the best approach as of now.

A more convenient way to update values inside document should be a good enhancement.

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

No branches or pull requests

2 participants