Socket
Socket
Sign inDemoInstall

aerospike

Package Overview
Dependencies
Maintainers
2
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aerospike - npm Package Compare versions

Comparing version 1.0.35 to 1.0.36

aerospike-1.0.36.tgz

63

docs/largelist.md

@@ -31,3 +31,2 @@ # LargeList Class

- [find(key, filter)](#findThenFilter)
- [getCapacity()](#getCapacity)
- [getConfig()](#getConfig)

@@ -40,3 +39,2 @@ - [findRange(begin, end)](#range)

- [scan()](#scan)
- [setCapacity()](#setCapacity)
- [size()](#size)

@@ -572,63 +570,2 @@ - [update(value)](#update)

```
<!--
################################################################################
setCapacity()
################################################################################
-->
<a name="setCapacity"></a>
###setCapacity(callback)
Set maximum number of entries in the list.
Parameters:
- `callback`- The function to call when the operation completes with the results of the operation.
The parameters for `callback` argument:
- `error` - The [Error object](datamodel.md#error) representing the status of
the operation.
- `response`- `undefined`
Example:
```js
llist.setCapacity(capacity, function(err, res){
//check for err.code
if(err.code != aerospike.status.AEROSPIKE_OK)
//signals error.
});
```
<!--
################################################################################
getCapacity()
################################################################################
-->
<a name="getCapacity"></a>
###getCapacity(callback)
Retrieves the capacity of the list - that is maximum number of entries.
Parameters:
- `callback`- The function to call when the operation completes with the results of the operation.
The parameters for `callback` argument:
- `error` - The [Error object](datamodel.md#error) representing the status of
the operation.
- `response`- Maximum number of entries in the list.
Example:
```js
llist.getCapacity(function(err, res){
//check for err.code
if(err.code != aerospike.status.AEROSPIKE_OK)
//signals error.
});
```

28

examples/llist.js

@@ -218,26 +218,18 @@ /*******************************************************************************

// set the list and verify the capacity of the list.
list.setCapacity(20, function(err, val){
checkError(err, "Set capacity verified");
list.getCapacity(function(err, val){
checkError(err, "get capacity verified");
// Get the size of the list and destroy the list.
list.size(function(err, val){
checkError(err, "Get size is verified");
console.log("The size of the list is ", val);
list.getConfig(function(err, val) {
console.log(val);
// Get the size of the list and destroy the list.
list.size(function(err, val){
checkError(err, "Get size is verified");
console.log("The size of the list is ", val);
list.getConfig(function(err, val) {
console.log(val);
// destroy the llist completely.
list.destroy(function(err, val) {
checkError(err, "The list is destroyed");
});
});
// destroy the llist completely.
list.destroy(function(err, val) {
checkError(err, "The list is destroyed");
});
});
});
});
});

@@ -98,2 +98,7 @@ var as = require('../build/Release/aerospike.node')

}
// @TO-DO options can be passed to V8 directly and parsed
// inside query.cc file.
// It's not neat to invoke a V8 function to set each property
// of query.
var queryObj = this.createQuery(ns, set);

@@ -228,7 +233,7 @@

policy: as.policy,
operator: as.operator,
operations: as.operations,
language: as.language,
log: as.log,
scanPriority: as.scanPriority,
filter: as.filter,
predicates : as.predicates,
indexType : as.indexType,

@@ -266,3 +271,84 @@ scanStatus: as.scanStatus

var populate_op = function(op, bin, value)
{
var obj = {};
obj.operation = op;
obj.bin = bin;
obj.value = value;
return obj;
}
var read_op = function(args)
{
return populate_op(as.operations.READ, arguments[0]);
}
var write_op = function(args)
{
return populate_op(as.operations.WRITE, arguments[0], arguments[1]);
}
var incr_op = function(args)
{
return populate_op(as.operations.INCR, arguments[0], arguments[1]);
}
var append_op = function(args)
{
return populate_op(as.operations.APPEND, arguments[0], arguments[1]);
}
var prepend_op = function(args)
{
return populate_op(as.operations.PREPEND, arguments[0], arguments[1]);
}
var touch_op = function(args)
{
var obj = {};
obj.operation = as.operations.TOUCH;
obj.ttl = arguments[0];
return obj;
}
aerospike.operator = {
read : read_op,
write: write_op,
incr: incr_op,
append: append_op,
prepend: prepend_op,
touch: touch_op
}
var equal_filter = function(args) {
var obj = {};
obj.predicate = as.predicates.EQUAL;
if(typeof(arguments[1]) == "number")
{
obj.type = as.indexType.NUMERIC;
}
else if(typeof(arguments[1]) == "string")
{
obj.type = as.indexType.STRING;
}
obj.bin = arguments[0];
obj.val = arguments[1];
return obj;
}
var range_filter = function(args) {
var obj = {};
obj.predicate = as.predicates.RANGE;
obj.type = as.indexType.NUMERIC;
obj.bin = arguments[0];
obj.min = arguments[1];
obj.max = arguments[2];
return obj;
}
aerospike.filter = {
equal: equal_filter,
range: range_filter
}
module.exports = aerospike;

@@ -194,13 +194,4 @@ function checkArgs(args, expArgLength)

}
LargeList.setCapacity = function(capacity, callback) {
this.executeLDTFunction("set_capacity", arguments, 2);
}
LargeList.getCapacity = function( callback) {
this.executeLDTFunction("get_capacity", arguments, 1);
}
return LargeList;
}
module.exports = LargeList;
{
"name" : "aerospike",
"version" : "1.0.35",
"version" : "1.0.36",
"description" : "Aerospike Client Library",

@@ -20,2 +20,5 @@ "tags" : [ "aerospike", "database", "nosql" ],

},
"dependencies" : {
"nan" : "~1.5.0"
},
"devDependencies": {

@@ -22,0 +25,0 @@ "mocha": ">0",

@@ -383,3 +383,3 @@ /*******************************************************************************

expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_ERR_LDT_NOT_FOUND);
expect(err.code).to.equal(status.AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND);
done();

@@ -453,42 +453,3 @@ });

});
it('should verify the getCapacity and setCapacity API of LList ', function(done) {
if(ldtEnabled)
{
var capacity = 25;
LList.setCapacity(capacity, function(err, val) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
LList.getCapacity(function(err, val) {
expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_OK);
expect(val).to.equal(capacity);
done();
});
});
}
else
{
done();
}
});
it('should verify the getCapacity and setCapacity API fails gracefully when wrong number of arguments are passed', function(done) {
if(ldtEnabled)
{
var capacity = 25;
LList.setCapacity(capacity, 24, function(err, val) {
expect(err).to.be.ok();
expect(err.func).to.equal('setCapacity ');
LList.getCapacity(3, function(err, val) {
expect(err).to.be.ok();
expect(err.func).to.equal('getCapacity ');
done();
});
});
}
else
{
done();
}
});
it('should verify the scan API of LList ', function(done) {

@@ -535,3 +496,3 @@ if(ldtEnabled)

expect(err).to.be.ok();
expect(err.code).to.equal(status.AEROSPIKE_ERR_LDT_NOT_FOUND);
expect(err.code).to.equal(status.AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND);
LList.size(function(err, val){

@@ -538,0 +499,0 @@ expect(err).to.be.ok();

@@ -18,3 +18,3 @@ /*******************************************************************************

// we want to test the built aerospike module
var aerospike = require('../build/Release/aerospike');
var aerospike = require('../lib/aerospike');
var options = require('./util/options');

@@ -21,0 +21,0 @@ var assert = require('assert');

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

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

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