Table of Contents
There are two different APIs that can be used to write Oracle NoSQL Database (Oracle NoSQL Database) applications: the original Key/Value API, and the Table API. In addition, the Key/Value API is available in Java and C. The Table API is available in Java, C, node.js (Javascript), and Python. This document describes how to write Oracle NoSQL Database applications using the Table API in node.js.
Most application developers should use one of the Table drivers because the Table API offers important features, including secondary indexes. Also, the Key/Value API will eventually be deprecated.
This document provides the concepts surrounding Oracle NoSQL Database, data schema considerations, as well as introductory programming examples.
This document is aimed at the software engineer responsible for writing an Oracle NoSQL Database application.
The following typographical conventions are used within in this manual:
Class names are represented in monospaced
font
, as are method names
.
For example: "The Configuration
class is
used to describe properties about a
Store
handle."
Variable or non-literal text is presented in italics. For example: "Go to your KVHOME directory."
Program examples are displayed in a monospaced
font
on a shaded background. For example:
//Include nosqldb-oraclejs module var nosqldb = require('nosqldb-oraclejs'); // Create a configuration object var configuration = new nosqldb.Configuration(); configuration.proxy.startProxy = false; configuration.proxy.host = 'localhost:7010'; configuration.storeHelperHosts = ['n1.example.org:5000']; configuration.storeName = 'kvstore'; configuration.username = 'jsapp-username';
In some situations, programming examples are updated from one
chapter to the next. When this occurs, the new code is presented in
monospaced bold
font. For example:
... // Store handle configuration and open skipped for brevity ... store.on('open', function () { console.log('Store opened');var fieldRange = new nosqldb.Types.FieldRange( "dateOfBirth", "1994-05-01", true, "1994-05-30", true);
store.indexIterator('myTable', 'DoB', {fieldRange: fieldRange
}, function (err, iterator) { if (err) throw err; else { // Configure Iterator event done iterator.on('done', function() { store.close(); }); console.log("Retrieved rows:"); iterator.forEach(function (err, returnRow) { if (err) throw err; else console.log(returnRow.row); console.log('\n'); }); } }); }).on('close', function() { console.log('Store closed.'); }).on('error', function(error) { console.log(error); }); store.open();
Finally, notes of special interest are represented using a note block such as this.