tiedot
tiedot copied to clipboard
add document entry
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...
- create?col=123
- '{"a": 1, "b": 2}' insert?col=123
now i need to add c3 so my steps are
- query?q=123 (so i get the document ID)
- get?col=Feeds&id=123123123123123123123
- Save response in memory (on local computer)
- add additional key/value in memory (on local computer)
- '{"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
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.