cloudant-nano
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -363,2 +363,12 @@ // Licensed under the Apache License, Version 2.0 (the 'License'); you may not | ||
// http://docs.couchdb.org/en/latest/api/server/common.html#uuids | ||
function uuids(count, callback) { | ||
if (typeof count === 'function') { | ||
callback = count; | ||
count = 1; | ||
} | ||
return relax({ method: 'GET', path: '_uuids', qs: {count: count}}, callback); | ||
} | ||
function docModule(dbName) { | ||
@@ -779,3 +789,4 @@ var docScope = {}; | ||
updates: updates, | ||
followUpdates: followUpdates | ||
followUpdates: followUpdates, | ||
uuids: uuids | ||
}); | ||
@@ -782,0 +793,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"repository": "git://github.com/cloudant-labs/cloudant-nano", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"author": "Glynn Bird <glynn.bird@gmail.com>", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
@@ -75,2 +75,3 @@ [![By](https://img.shields.io/badge/made%20by-yld!-32bbee.svg?style=flat-square)](http://yld.io/contact?source=github-nano)[![Chat](https://img.shields.io/badge/help-gitter-eb9348.svg?style=flat-square)](https://gitter.im/dscape/nano)[![Tests](http://img.shields.io/travis/dscape/nano.svg?style=flat-square)](https://travis-ci.org/dscape/nano)![Coverage](https://img.shields.io/badge/coverage-100%-ff69b4.svg?style=flat-square)[![Dependencies](https://img.shields.io/david/dscape/nano.svg?style=flat-square)](https://david-dm.org/dscape/nano)[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](http://browsenpm.org/package/nano) | ||
- [advanced features](#advanced-features) | ||
- [getting uuids](#getting-uuids) | ||
- [extending nano](#extending-nano) | ||
@@ -791,2 +792,17 @@ - [pipes](#pipes) | ||
### getting uuids | ||
if your application needs to generate UUIDs, then CouchDB can provide some for you | ||
```js | ||
nano.uuids(3, callback); | ||
// { uuid: [ | ||
// '5d1b3ef2bc7eea51f660c091e3dffa23', | ||
// '5d1b3ef2bc7eea51f660c091e3e006ff', | ||
// '5d1b3ef2bc7eea51f660c091e3e007f0', | ||
//]} | ||
``` | ||
The first parameter is the number of uuids to generate. If omitted, it defaults to 1. | ||
### extending nano | ||
@@ -793,0 +809,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219737
128
5179
919