Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

couchdb-client

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-client - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

package.json
{
"name": "couchdb-client",
"version": "1.0.7",
"version": "1.0.8",
"description": "A simple couchdb client",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -81,2 +81,3 @@ # CouchDBClient

```js
var rev;
client.getDB('foo', function (err, data) {

@@ -86,2 +87,3 @@ if (err) {

} else {
rev = data.rev;
console.log(data);

@@ -95,3 +97,3 @@ }

```js
client.deleteDB('foo', function (err, data) {
client.deleteDB('foo', rev, function (err, data) {
if (err) {

@@ -103,15 +105,72 @@ console.error(err);

});
```
## #addDoc(name, id, [rev], callback)
Adds a doc, could also be used to update a doc.
```js
var rev2;
client.addDoc('foo', 'bar', {hi: true, bye false}, function (err, data) {
if (err) {
console.error(err);
} else {
rev2 = data.rev;
console.log(data);
}
});
```
## #getDoc(name, id, callback)
Gets a document from the database.
```js
client.getDoc('foo', 'bar', function (err, data) {
if (err) {
console.error(err);
} else {
console.log(data);
}
});
```
## #deleteDoc(name, id, rev, callback)
Deletes a document.
```js
client.deleteDoc('foo', 'bar', rev, function (err, data) {
if (err) {
console.error(err);
} else {
console.log(data);
}
});
```
## #addView(name, id, obj, callback)
Adds or updates a view.
```js
client.addView('test', 'stuff', {all: {map: "function (doc){emit(null,doc)}"}}, function (err, data) {
if (err) {
console.error(err);
} else {
rev = data.rev;
console.log(data);
}
});
```
## #deleteView(name, id, rev, callback)
Deletes a view.
```js
client.deleteView('test', 'stuff', rev, function (err, data) {
if (err) {
console.error(err);
} else {
console.log(data);
}
});
```
## #useView(name, id, view, [key,] callback)
Uses a view with the specified key.
```js
client.useView('test', 'stuff', 'all', 'hi', function (err, data) {
if (err) {
console.error(err);
} else {
console.log(data);
}
});
```
## Test

@@ -118,0 +177,0 @@ ```bash

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc