-
mentaxis there any simple way to run search across all the tables in couchdb?
-
ruelmentax: tables? what is tables? :)
-
ruelI assume u mean all the DBs?
-
ruelIf so, not without writing a script of some sort.
-
mentaxyes, seaerch in all dbs
-
ruelfairly easy with bash I guess
-
ruelhere's an example of using a bash for loop to get all DB names and run a DELETE command on each, but you could replace the DELETE with a GET on a view or whatnot:
-
ruelfor i in `curl -su admin:CouCHpa22w0rd localhost:15984/_all_dbs | jq . | sed 's/"//g' | sed 's/,/ /g' | sed 's/]//g' | sed 's/\//%2F/g' | sed 's/_users//g' | sed 's/_replicator//g' | sed 's/\[//g'` ; do curl -su admin:CouCHpa22w0rd localhost:15984/$i -X DELETE | jq .; done
-
ruelI'm sure that could be improved markedly without all the chained sed commands lol.