aerospike
Advanced tools
Comparing version 1.0.37 to 1.0.38
@@ -21,2 +21,3 @@ # Client Class | ||
- [batchGet()](#batchGet) | ||
- [batchSelect()](#batchSelect) | ||
- [close()](#close) | ||
@@ -153,3 +154,60 @@ - [connect()](#connect) | ||
``` | ||
<!-- | ||
################################################################################ | ||
batchSelect() | ||
################################################################################ | ||
--> | ||
<a name="batchSelect"></a> | ||
### batchSelect(keys, policy=null, callback) | ||
Reads a batch of records from the database cluster. | ||
Parameters: | ||
- `keys` – An array of [Key objects](datamodel.md#key), used to locate the records in the cluster. | ||
- `bins` – An array of bin names for the bins to be returned for the given keys. | ||
- `policy` – (optional) The [Batch Policy object](policies.md#WritePolicy) to use for this operation. | ||
- `callback` – The function to call when the operation completes, with the results of the batch operation. | ||
The parameters for the `callback` argument: | ||
- `error` – The [Error object](datamodel.md#error) representing the status of | ||
the operation. | ||
- `results` – An array of objects, where each object contains the following attributes: | ||
- `status` - status of the record. [Status code](status.md). | ||
- `key` - key of the record. [Key object](datamodel.md#key). | ||
- `record` - the record read from the cluster containing only the selected bins. [Record object](datamodel.md#record). | ||
- `metadata` - metadata of the record. [Metadata object](datamodel.md#metadata). | ||
Example: | ||
```js | ||
var key = aerospike.key | ||
var keys = [ | ||
key('test', 'demo', 'key1'), | ||
key('test', 'demo', 'key2'), | ||
key('test', 'demo', 'key3') | ||
] | ||
var bins = ['name', 'age']; | ||
client.batchSelect(keys, bins, function(error, results) { | ||
for ( var i = 0; i<results.length; i++) { | ||
var result = results[i]; | ||
switch ( result.status ) { | ||
case status.AEROSPIKE_OK: | ||
// record found | ||
break; | ||
case status.AEROSPIKE_ERR_RECORD_NOT_FOUND: | ||
// record not found | ||
break; | ||
default: | ||
// error while reading record | ||
break; | ||
} | ||
} | ||
}); | ||
``` | ||
<!-- | ||
@@ -156,0 +214,0 @@ ################################################################################ |
@@ -12,5 +12,3 @@ # Filters | ||
var queryArgs = { filters = [ | ||
filter.equal('a', 'hello'), | ||
filter.equal('b', 123), | ||
filter.range('c', 1, 1000) | ||
filter.equal('a', 'hello') | ||
] | ||
@@ -17,0 +15,0 @@ } |
{ | ||
"name" : "aerospike", | ||
"version" : "1.0.37", | ||
"version" : "1.0.38", | ||
"description" : "Aerospike Client Library", | ||
@@ -5,0 +5,0 @@ "tags" : [ "aerospike", "database", "nosql" ], |
@@ -5,3 +5,3 @@ # Aerospike Node.js Client | ||
This module is compatible with Node.js 0.10.x and supports the following operating systems: CentOS/RHEL 6.x, Debian 6+, Ubuntu 12.04, Ubuntu 14.04, Mac OS X. | ||
This module is compatible with Node.js v0.10.x and v0.12.x, and supports the following operating systems: CentOS/RHEL 6.x, Debian 6+, Ubuntu 12.04, Ubuntu 14.04, Mac OS X. | ||
@@ -48,14 +48,21 @@ - [Usage](#Usage) | ||
// Read the record from the database | ||
client.get(key, function(err, rec, meta) { | ||
var bins = { i: 123, s: "str"} | ||
var metadata = { ttl: 10000, gen: 1} | ||
// write a record to database. | ||
client.put(key, bins, metadata, function(err, key){ | ||
// Read the same record from database | ||
client.get(key, function(err, rec, meta) { | ||
// Check for errors | ||
if ( err.code == status.AEROSPIKE_OK ) { | ||
// The record was successfully read. | ||
console.log(rec, meta); | ||
} | ||
else { | ||
// An error occurred | ||
console.error('error:', err); | ||
} | ||
// Check for errors | ||
if ( err.code == status.AEROSPIKE_OK ) { | ||
// The record was successfully read. | ||
console.log(rec, meta); | ||
} | ||
else { | ||
// An error occurred | ||
console.error('error:', err); | ||
} | ||
}); | ||
}); | ||
@@ -72,4 +79,7 @@ ``` | ||
[Node.js](http://nodejs.org) version v0.10.x is required. | ||
[Node.js](http://nodejs.org) version v0.10.x or v0.12.x is required. | ||
Aerospike is an addon module written using V8. To compile V8 g++ must be installed in | ||
the system. | ||
To install the latest stable version of Node.js, visit | ||
@@ -76,0 +86,0 @@ [http://nodejs.org/download/](http://nodejs.org/download/) |
@@ -46,3 +46,3 @@ /******************************************************************************* | ||
alias: "t", | ||
default: 10, | ||
default: 100, | ||
describe: "Timeout in milliseconds." | ||
@@ -49,0 +49,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
903637
138
10622
388
35