25.01.2015 Views

Using Node.js with Caché - InterSystems Documentation

Using Node.js with Caché - InterSystems Documentation

Using Node.js with Caché - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table of Contents<br />

About This Book .................................................................................................................................... 1<br />

1 Introduction ........................................................................................................................................ 3<br />

2 Installation ........................................................................................................................................... 5<br />

2.1 UNIX .......................................................................................................................................... 5<br />

2.2 Windows ..................................................................................................................................... 6<br />

3 Accessing <strong>Caché</strong> from <strong>Node</strong>.<strong>js</strong> ........................................................................................................... 7<br />

3.1 JSON Objects and <strong>Caché</strong> Globals .............................................................................................. 7<br />

3.2 Synchronous vs. Asynchronous cache.node Methods ................................................................ 8<br />

3.3 Overview of cache.node Methods .............................................................................................. 9<br />

3.4 Opening and Closing the <strong>Caché</strong> Database ............................................................................... 10<br />

3.5 Advanced Data Access <strong>with</strong> retrieve() and update() ................................................................ 11<br />

3.5.1 <strong>Using</strong> retrieve() .............................................................................................................. 11<br />

3.5.2 <strong>Using</strong> update() ................................................................................................................ 15<br />

3.6 Towards an Object Oriented Development Methodology ........................................................ 16<br />

4 Reference for cache.node Methods ................................................................................................. 17<br />

4.1 Example Data ........................................................................................................................... 18<br />

4.2 close() ....................................................................................................................................... 18<br />

4.3 data() ......................................................................................................................................... 18<br />

4.4 function() .................................................................................................................................. 19<br />

4.5 get() .......................................................................................................................................... 20<br />

4.6 global_directory() ..................................................................................................................... 21<br />

4.7 increment() ............................................................................................................................... 22<br />

4.8 kill() .......................................................................................................................................... 22<br />

4.9 lock() ........................................................................................................................................ 23<br />

4.10 merge() ................................................................................................................................... 23<br />

4.11 next() or order() ...................................................................................................................... 24<br />

4.12 next_node() ............................................................................................................................. 25<br />

4.13 open() ..................................................................................................................................... 27<br />

4.14 previous() ................................................................................................................................ 27<br />

4.15 previous_node() ...................................................................................................................... 28<br />

4.16 retrieve() ................................................................................................................................. 30<br />

4.17 set() ......................................................................................................................................... 32<br />

4.18 unlock() .................................................................................................................................. 32<br />

4.19 update() ................................................................................................................................... 33<br />

4.20 version() and about() .............................................................................................................. 34<br />

Appendix A: Building cache.node from Source ................................................................................ 37<br />

A.1 <strong>Using</strong> the <strong>Node</strong>.<strong>js</strong> Build Procedure ......................................................................................... 37<br />

A.1.1 Creating the Build Script (wscript) ............................................................................... 37<br />

A.1.2 Build the cache.node Module ........................................................................................ 38<br />

A.2 Building Directly from Source ................................................................................................ 38<br />

<strong>Using</strong> <strong>Node</strong>.<strong>js</strong> <strong>with</strong> <strong>Caché</strong><br />

iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!