How to use the aerospike.status function in aerospike

To help you get started, we’ve selected a few aerospike examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aerospike-edu / student-workbook / deprecated / answers / Key-valueOperations / Node / app.js View on Github external
}).connect(function(response) {
    // Check for errors
    if ( response.code == aerospike.status.AEROSPIKE_OK ) {
      // Connection succeeded
      console.log("Connection to the Aerospike cluster succeeded!");
    }
    else {
      // Connection failed
      console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
      process.exit(0);
    }
});
github aerospike-edu / student-workbook / deprecated / answers / Complete / Node / app.js View on Github external
}).connect(function(response) {
    // Check for errors
    if ( response.code == aerospike.status.AEROSPIKE_OK ) {
      // Connection succeeded
      console.log("Connection to the Aerospike cluster succeeded!");
    }
    else {
      // Connection failed
      console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
      process.exit(0);
    }
});
github aerospike-edu / student-workbook / deprecated / exercises / RecordUDF / Node / app.js View on Github external
}).connect(function(response) {
    // Check for errors
    if ( response.code == aerospike.status.AEROSPIKE_OK ) {
      // Connection succeeded
      console.log("Connection to the Aerospike cluster succeeded!");
    }
    else {
      // Connection failed
      console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
      process.exit(0);
    }
});
github aerospike-edu / student-workbook / deprecated / answers / Aggregations / Node / app.js View on Github external
}).connect(function(response) {
    // Check for errors
    if ( response.code == aerospike.status.AEROSPIKE_OK ) {
      // Connection succeeded
      console.log("Connection to the Aerospike cluster succeeded!");
    }
    else {
      // Connection failed
      console.log("Connection to the Aerospike cluster failed. Please check cluster IP and Port settings and try again.");
      process.exit(0);
    }
});
github aerospike / aerospike-client-nodejs / examples / range_remove.js View on Github external
//
//    Read records with keys in range 1-100, skipping every fifth
//
//      node range_get --start 1 --end 100 --skip 5
//
//    Write records with keys in range 900-1000
//
//      node range_put --start 900
// *****************************************************************************

const fs = require('fs')
const Aerospike = require('aerospike')
const yargs = require('yargs')
const deasync = require('deasync')

const Status = Aerospike.status

// *****************************************************************************
// Options parsing
// *****************************************************************************

var argp = yargs
  .usage('$0 [options]')
  .options({
    help: {
      boolean: true,
      describe: 'Display this message.'
    },
    host: {
      alias: 'h',
      default: process.env.AEROSPIKE_HOSTS || 'localhost:3000',
      describe: 'Aerospike database address.'
github aerospike / aerospike-client-nodejs / benchmarks / worker.js View on Github external
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// *****************************************************************************

// *****************************************************************************
// Benchmark Worker, run operations and report results.
// *****************************************************************************

var aerospike = require('aerospike')
var cluster = require('cluster')
var util = require('util')
var winston = require('winston')
var stats = require('./stats')
var status = aerospike.status
var alerts = require('./alerts.js')
var argv = require('./config.json')

// *****************************************************************************
//  MACROS
// *****************************************************************************

var OP_TYPES = 4 // READ, WRITE, QUERY and SCAN
var READ = 0
var WRITE = 1
var QUERY = 2
var SCAN = 3
var TPS = 0
var TIMEOUT = 1
var ERROR = 2
github aerospike / aerospike-client-nodejs / examples / query_geospatial.js View on Github external
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// *****************************************************************************

// *****************************************************************************
// Write a record
// *****************************************************************************

const Aerospike = require('aerospike')
const fs = require('fs')
const yargs = require('yargs')

const status = Aerospike.status
const filter = Aerospike.filter
const GeoJSON = Aerospike.GeoJSON
const Key = Aerospike.Key

// *****************************************************************************
// Options parsing
// *****************************************************************************

var argp = yargs
  .usage('$0 [options] key')
  .options({
    help: {
      boolean: true,
      describe: 'Display this message.'
    },
    host: {
github aerospike / aerospike-client-nodejs / examples / range_get.js View on Github external
//
//    Read records with keys in range 1-100, skipping every fifth
//
//      node range_get --start 1 --end 100 --skip 5
//
//    Write records with keys in range 900-1000
//
//      node range_put --start 900
// *****************************************************************************

const Aerospike = require('aerospike')
const fs = require('fs')
const yargs = require('yargs')
const deasync = require('deasync')

const Status = Aerospike.status

// *****************************************************************************
// Options parsing
// *****************************************************************************

var argp = yargs
  .usage('$0 [options]')
  .options({
    help: {
      boolean: true,
      describe: 'Display this message.'
    },
    host: {
      alias: 'h',
      default: process.env.AEROSPIKE_HOSTS || 'localhost:3000',
      describe: 'Aerospike database address.'
github aerospike / aerospike-client-nodejs / examples / batch.js View on Github external
const request = {
      key: new Aerospike.Key(argv.namespace, argv.set, key)
    }
    if (argv.bins) {
      request.bins = argv.bins
    } else {
      request.read_all_bins = true
    }
    return request
  })

  const batchResults = await client.batchRead(batch)

  for (const result of batchResults) {
    const record = result.record
    console.info(record.key.key, ':', result.status === Aerospike.status.OK
      ? record.bins : 'NOT FOUND')
  }
}
github aerospike / aerospike-client-nodejs / examples / simple_put.js View on Github external
* See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

/*******************************************************************************
 *
 * Write a record.
 * 
 ******************************************************************************/

var fs = require('fs');
var aerospike = require('aerospike');
var yargs = require('yargs');

var Policy = aerospike.policy;
var Status = aerospike.status;

/*******************************************************************************
 *
 * Options parsing
 * 
 ******************************************************************************/

var argp = yargs
    .usage("$0 [options] ")
    .options({
        help: {
            boolean: true,
            describe: "Display this message."
        },
        profile: {
            boolean: true,