Does a GET request to "_all_dbs".
An array with all the databases.
Does a GET request to "/".
The version of the CouchDB installation.
Replicates the content of the source db to the target db.
The target db contains all the documents from the source db.
{"ok": true, "session_id": "a session id", "source_last_seq": 1, "history": [{"session_id": "a session id", "start_time": "start time", "end_time": "end time", "start_last_seq": 0, "end_last_seq": 1, "recorded_seq": 1, "missing_checked": 0, "missing_found": 1, "docs_read": 1, "docs_written": 1, "doc_write_failures": 0}]}
With the create_target option, the target db gets created if it doesn't already exist: CouchDB.replicate(http://localhost:5984/test_db, http://localhost:5984/test_db2, {"body" : {"create_target":true}})
Returns an XMLHTTPRequest or an ActiveXObject, depending on the OS. If no XMLHTTPRequest support is detected, an error is thrown.
A new XMLHTTPRequest or nothing.
Creates a new XMLHTTPRequest. If the URI parameter doesn't start with "http://", the URI is prefixed with the CouchDB urlPrefix. If there are headers given in the options hash, they are set via setRequestHeader. The request is sent with the specified method.
The XMLHTTPRequest has been sent with the given parameters.
A new XMLHTTPRequest with readyState 4.
CouchDB.request("GET", "/", {"headers": {"X-Couch-Full-Commit":"true"}});
Does a GET request to "/_stats/module/key".
Statistics about the specified module and key.
This returns the number of open databases: CouchDB.requestStats('couchdb', 'open_databases', test); When the last argument is not null, "?flush=true" is appended to the request.
The CouchDB.uuids_cache is filled with as many UUIDs as specified in the buffer parameter, or with 100. The next time newUuids is called, they aren't requested from CouchDB, but taken directly from this cache if the cache contains enough of them.
An array with the specified amount of UUIDs.
The first request gives you 10 UUIDs, the second 125. CouchDB.newUuids(10); CouchDB.newUuids(125, 60); The uuids_cache now contains 160 UUIDs.
Throws an error when the given request has a status greater than 400.
var req = CouchDB.request("GET", "/nonexisting_db")
results in a 404 error, so CouchDB.maybeThrowError(req) returns {"error": "not_found", "reason": "no_db_file"}
Turns a json object into a http params string.
A string with the keys and values separated by "=" and "&" or an empty string when the options are empty.
CouchDB.params({"key":"value", "key2":"value2"})
returns "key=value&key2=value2"