@prathibha I tried this:
root@database-server-02-Automation:~# curl -X POST -v -u admin:admin http://x.x.x.x:5984/query/service -d statement=CREATE%20PRIMARY%20INDEX%20primary_index%20ON%20default:default%20USING%20GSI
Note: Unnecessary use of -X or --request, POST is already inferred.
-
Trying x.x.x.x…
-
TCP_NODELAY set
-
Connected to x.x.x.x (x.x.x.x) port 5984 (#0)
-
Server auth using Basic with user ‘admin’
POST /query/service HTTP/1.1
Host: x.x.x.x:5984
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: curl/7.58.0
Accept: /
Content-Length: 87
Content-Type: application/x-www-form-urlencoded
- upload completely sent off: 87 out of 87 bytes
< HTTP/1.1 404 Object Not Found
< Cache-Control: must-revalidate
< Connection: close
< Content-Length: 58
< Content-Type: application/json
< Date: Fri, 15 Nov 2019 06:04:27 GMT
< Server: CouchDB/2.3.1 (Erlang OTP/19)
< X-Couch-Request-ID: 01e04837e0
< X-CouchDB-Body-Time: 0
<
{“error”:“not_found”,“reason”:“Database does not exist.”}
- Closing connection 0
root@database-server-02-Automation:~#
I want to create index for all a database lets say test . COuld you help?