E
E
Evgeny Nikolaev2017-02-23 16:05:43
Angular
Evgeny Nikolaev, 2017-02-23 16:05:43

How to update data in Couch DB from JS?

Good day, I use Couch DB for data storage.
I send a get request from Angular, get JSON and work with it, everything is fine here, but when it becomes necessary to save the data back, there is a problem. I can’t figure it out, I wrote the entire manual for the Curl utility.
So the question is, how should a request be formed in AngularJS (Well, or pure JS) to change or add a document to CouchDB.
This option is offered by the Curl utility.

curl -X PUT http://127.0.0.1:5984/database_name/document_id/ -d '{ "field" : "value", "_rev" : "revision id" }'

Oh yes, I have a NodeJS Express server, maybe it can work with CouchDB?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ozknemoy, 2017-03-03
@ozknemoy

How do you query data with Angular? maybe $http.get(someUrl) ? and save is $http.put(someUrl,someObjectWithProps)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question