SlideShare a Scribd company logo
1 of 52
Copyright © 2016 M/Gateway Developments Ltd
EWD 3 Training Course
Part 22
JavaScript Abstraction of Global Storage:
(c) Traversing Documents
Rob Tweed
Director, M/Gateway Developments Ltd
Twitter: @rtweed
Copyright © 2016 M/Gateway Developments Ltd
Traversing a Global Node using the cache.node order function:
var node = {
global: 'myGlobal',
subscripts: ['d', 'e2', '' ]
};
var subscript;
do {
subscript = db.order(node).result;
if (subscript !== '') console.log(subscript);
}
while (subscript !== '');
myGlobal("d","e2","f1")="bar1"
myGlobal("d","e2","f2")="bar2"
myGlobal("d","e2","f3")="bar3"
"f1", "f2", "f3"
Traversal the hard way
Copyright © 2016 M/Gateway Developments Ltd
DocumentNode Object method:
forEachChild()
Traversal made easy and intuitive
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes of a
DocumentNode Object
– ie through subscripts in underlying Global
Storage
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes
– ie through subscripts in underlying Global
Storage
– docNode.forEachChild(function(nodeName, childNode) {…});
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes
– ie through subscripts in underlying Global
Storage
– docNode.forEachChild( function(nodeName, childNode) {…}) ;
– Callback function fires on every iteration
• ie every time a child node is found
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes
– ie through subscripts in underlying Global
Storage
– docNode.forEachChild(function(nodeName, childNode) {…});
Child node's Node Name (ie subscript)
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes
– ie through subscripts in underlying Global
Storage
– docNode.forEachChild(function(nodeName, childNode) {…});
Child node's Node Name (ie subscript)
DocumentNode object representing the
Child node
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName) {
// do something with the node name / subscript for this iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName) {
// 1st iteration nodeName === 'f1’
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName) {
// 2nd iteration nodeName === 'f2’
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName) {
// 3rd iteration nodeName === 'f3’
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName) {
console.log(nodeName);
});
forEachChild() Method
f1
f2
f3
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// do something with the childNode DocumentNode object for this iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// do something with the childNode DocumentNode object for this iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// 1st iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// 2nd iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// 3rd iteration
});
forEachChild() Method
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// do something with the childNode DocumentNode object for this iteration
});
forEachChild() Method
childNode is a DocumentNode Object, so has all the usual properties and methods
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
console.log(childNode.value);
});
forEachChild() Method
bar1
bar2
bar3
Copyright © 2016 M/Gateway Developments Ltd
forEachChild() Method
• Iterates through all child nodes
– docNode.forEachChild(function(nodeName, childNode) {…});
• Note that because ewd-document-store uses synchronous versions of
underlying cache.node APIs, the call-backs fire in synchronous order
• Additionally, the forEachChild() function will wait until completion before next
command executes
• This greatly simplifies its use!
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
console.log('start…');
e2Node.forEachChild(function(nodeName, childNode) {
console.log(childNode.value);
});
console.log('end');
Example
start…
bar1
bar2
bar3
end
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
console.log('start…');
e2Node.forEachChild(function(nodeName, childNode) {
console.log(childNode.value);
});
console.log('end');
Example
This can be done safely because QEWD uses
the master / worker architecture of ewd-qoper8
where your handler functions run on their own
in an isolated process
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
e2Node.forEachChild(function(nodeName, childNode) {
// if callback function returns true (exit boolean flag), it stops the loop
});
Stopping forEachChild() Early
Copyright © 2016 M/Gateway Developments Ltd
myDoc("d","e2","f1")="bar1"
myDoc("d","e2","f2")="bar2"
myDoc("d","e2","f3")="bar3"
var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']);
var count = 0;
e2Node.forEachChild(function(nodeName, childNode) {
count++;
if (count === 3) return true;
console.log(childNode.value);
});
Stopping forEachChild() Early
bar1
bar2
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
Traversal of all nodes and subnodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
// do something with child node
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
// 1st iteration
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
// 1st iteration
childNode.forEachChild(function(nodeName, childNode) {
// do something with grand-child node
});
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
// 1st iteration
childNode.forEachChild(function(nodeName, childNode) {
// 1st iteration
});
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
console.log(nodeName);
childNode.forEachChild(function(nodeName, childNode) {
console.log(childNode.value);
});
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nested forEachChild() loops
var dNode = new this.documentStore.DocumentNode('myDoc', ['d']);
dNode.forEachChild(function(nodeName, childNode) {
console.log(nodeName);
childNode.forEachChild(function(nodeName, childNode) {
console.log(childNode.value);
});
});
e1
bar1a
bar2a
e2
bar1b
bar2b
bar3b
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Nest as deeply as you wish
var doc = new this.documentStore.DocumentNode('myDoc');
doc.forEachChild(function(nodeName, childNode) {
childNode.forEachChild(function(nodeName, childNode) {
childNode.forEachChild(function(nodeName, childNode) {
// do something with innermost node
});
});
});
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
forEachChild() in reverse order?
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
forEachChild() in reverse order
var myDoc = new this.documentStore.DocumentNode('myDoc', [ ]);
myDoc.forEachChild( {direction: 'reverse'} , function(nodeName, childNode) {
console.log(nodeName);
});
Use optional control object argument
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
forEachChild() in reverse order
var myDoc = new this.documentStore.DocumentNode('myDoc', [ ]);
myDoc.forEachChild( {direction: 'reverse'} , function(nodeName, childNode) {
console.log(nodeName);
});
d
b
a
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
console.log(myDoc.firstChild.value); // 123
firstChild returns a DocumentNode object
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
console.log(myDoc.firstChild.value); // 123
console.log(myDoc.firstChild.name); // a
firstChild returns a DocumentNode object
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
console.log(myDoc.lastChild.name); // d
lastChild also returns a DocumentNode object
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
console.log(myDoc.firstChild.nextSibling.name); // b
nextSibling returns a DocumentNode object
Copyright © 2016 M/Gateway Developments Ltd
myDoc("a")=123
myDoc("b","c1")="foo"
myDoc("b","c2")="foo2"
myDoc("d","e1","f1a")="bar1a"
myDoc("d","e1","f2a")="bar2a"
myDoc("d","e2","f1b")="bar1b"
myDoc("d","e2","f2b")="bar2b"
myDoc("d","e2","f3b")="bar3b"
Navigating to Specific Nodes
var myDoc = new this.documentStore.DocumentNode('myDoc');
console.log(myDoc.lastChild.previousSibling.name); // b
previousSibling returns a DocumentNode object

More Related Content

What's hot

Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
Dinh Pham
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
Amit Thakkar
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 
A million connections and beyond - Node.js at scale
A million connections and beyond - Node.js at scaleA million connections and beyond - Node.js at scale
A million connections and beyond - Node.js at scale
Tom Croucher
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
IndicThreads
 

What's hot (20)

NodeJS
NodeJSNodeJS
NodeJS
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js Explained
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
NodeJS
NodeJSNodeJS
NodeJS
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Understanding the Node.js Platform
Understanding the Node.js PlatformUnderstanding the Node.js Platform
Understanding the Node.js Platform
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & Express
 
Getting started with developing Nodejs
Getting started with developing NodejsGetting started with developing Nodejs
Getting started with developing Nodejs
 
A million connections and beyond - Node.js at scale
A million connections and beyond - Node.js at scaleA million connections and beyond - Node.js at scale
A million connections and beyond - Node.js at scale
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Developing node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDBDeveloping node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDB
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 

Viewers also liked

Viewers also liked (20)

EWD 3 Training Course Part 18: Modelling NoSQL Databases using Global Storage
EWD 3 Training Course Part 18: Modelling NoSQL Databases using Global StorageEWD 3 Training Course Part 18: Modelling NoSQL Databases using Global Storage
EWD 3 Training Course Part 18: Modelling NoSQL Databases using Global Storage
 
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 4
 
EWD 3 Training Course Part 30: Modularising QEWD Applications
EWD 3 Training Course Part 30: Modularising QEWD ApplicationsEWD 3 Training Course Part 30: Modularising QEWD Applications
EWD 3 Training Course Part 30: Modularising QEWD Applications
 
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
EWD 3 Training Course Part 38: Building a React.js application with QEWD, Part 2
 
EWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven IndexingEWD 3 Training Course Part 26: Event-driven Indexing
EWD 3 Training Course Part 26: Event-driven Indexing
 
EWD 3 Training Course Part 31: Using QEWD for Web and REST Services
EWD 3 Training Course Part 31: Using QEWD for Web and REST ServicesEWD 3 Training Course Part 31: Using QEWD for Web and REST Services
EWD 3 Training Course Part 31: Using QEWD for Web and REST Services
 
EWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD SessionEWD 3 Training Course Part 27: The QEWD Session
EWD 3 Training Course Part 27: The QEWD Session
 
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWDEWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
EWD 3 Training Course Part 28: Integrating Legacy Mumps Code with QEWD
 
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
 
EWD 3 Training Course Part 23: Traversing a Range using DocumentNode Objects
EWD 3 Training Course Part 23: Traversing a Range using DocumentNode ObjectsEWD 3 Training Course Part 23: Traversing a Range using DocumentNode Objects
EWD 3 Training Course Part 23: Traversing a Range using DocumentNode Objects
 
Mumps the Internet scale database
Mumps the Internet scale databaseMumps the Internet scale database
Mumps the Internet scale database
 
EWD 3 Training Course Part 8: Anatomy of the QEWD Messaging Cycle
EWD 3 Training Course Part 8: Anatomy of the QEWD Messaging CycleEWD 3 Training Course Part 8: Anatomy of the QEWD Messaging Cycle
EWD 3 Training Course Part 8: Anatomy of the QEWD Messaging Cycle
 
EWD 3 Training Course Part 24: Traversing a Document's Leaf Nodes
EWD 3 Training Course Part 24: Traversing a Document's Leaf NodesEWD 3 Training Course Part 24: Traversing a Document's Leaf Nodes
EWD 3 Training Course Part 24: Traversing a Document's Leaf Nodes
 
EWD 3 Training Course Part 25: Document Database Capabilities
EWD 3 Training Course Part 25: Document Database CapabilitiesEWD 3 Training Course Part 25: Document Database Capabilities
EWD 3 Training Course Part 25: Document Database Capabilities
 
EWD 3 Training Course Part 16: QEWD Services
EWD 3 Training Course Part 16: QEWD ServicesEWD 3 Training Course Part 16: QEWD Services
EWD 3 Training Course Part 16: QEWD Services
 
EWD 3 Training Course Part 7: Applying the QEWD Messaging Pattern
EWD 3 Training Course Part 7: Applying the QEWD Messaging PatternEWD 3 Training Course Part 7: Applying the QEWD Messaging Pattern
EWD 3 Training Course Part 7: Applying the QEWD Messaging Pattern
 
EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started
EWD 3 Training Course Part 6: What Happens when a QEWD Application is StartedEWD 3 Training Course Part 6: What Happens when a QEWD Application is Started
EWD 3 Training Course Part 6: What Happens when a QEWD Application is Started
 
EWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIsEWD 3 Training Course Part 19: The cache.node APIs
EWD 3 Training Course Part 19: The cache.node APIs
 

Similar to EWD 3 Training Course Part 22: Traversing Documents using DocumentNode Objects

Артем Маркушев - JavaScript
Артем Маркушев - JavaScriptАртем Маркушев - JavaScript
Артем Маркушев - JavaScript
DataArt
 
Node js
Node jsNode js
Node js
hazzaz
 

Similar to EWD 3 Training Course Part 22: Traversing Documents using DocumentNode Objects (20)

EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩くEWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩くEWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
EWD 3トレーニングコース#24 GlobalストレージのJavaScript用抽象化-(e) ドキュメントの末端ノードを渡り歩く
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
Артем Маркушев - JavaScript
Артем Маркушев - JavaScriptАртем Маркушев - JavaScript
Артем Маркушев - JavaScript
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
LISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesLISA QooxdooTutorial Slides
LISA QooxdooTutorial Slides
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for Java
 
Groovy and Grails talk
Groovy and Grails talkGroovy and Grails talk
Groovy and Grails talk
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
20151224-games
20151224-games20151224-games
20151224-games
 
Node js
Node jsNode js
Node js
 
Book
BookBook
Book
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Webinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.jsWebinar: Building Your First App in Node.js
Webinar: Building Your First App in Node.js
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 

More from Rob Tweed

More from Rob Tweed (18)

QEWD Update
QEWD UpdateQEWD Update
QEWD Update
 
Data Persistence as a Language Feature
Data Persistence as a Language FeatureData Persistence as a Language Feature
Data Persistence as a Language Feature
 
LNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It TooLNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It Too
 
EWD 3 Training Course Part 45: Using QEWD's Advanced MicroService Functionality
EWD 3 Training Course Part 45: Using QEWD's Advanced MicroService FunctionalityEWD 3 Training Course Part 45: Using QEWD's Advanced MicroService Functionality
EWD 3 Training Course Part 45: Using QEWD's Advanced MicroService Functionality
 
EWD 3 Training Course Part 44: Creating MicroServices with QEWD.js
EWD 3 Training Course Part 44: Creating MicroServices with QEWD.jsEWD 3 Training Course Part 44: Creating MicroServices with QEWD.js
EWD 3 Training Course Part 44: Creating MicroServices with QEWD.js
 
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST ServicesEWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
 
QEWD.js, JSON Web Tokens & MicroServices
QEWD.js, JSON Web Tokens & MicroServicesQEWD.js, JSON Web Tokens & MicroServices
QEWD.js, JSON Web Tokens & MicroServices
 
QEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It TooQEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It Too
 
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Servicesewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
ewd-qoper8-vistarpc: Exposing VistA's RPCs as REST Services
 
qewd-ripple: The Ripple OSI Middle Tier
qewd-ripple: The Ripple OSI Middle Tierqewd-ripple: The Ripple OSI Middle Tier
qewd-ripple: The Ripple OSI Middle Tier
 
EWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker ApplianceEWD 3 Training Course Part 42: The QEWD Docker Appliance
EWD 3 Training Course Part 42: The QEWD Docker Appliance
 
EWD 3 Training Course Part 5b: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5b: First Steps in Building a QEWD ApplicationEWD 3 Training Course Part 5b: First Steps in Building a QEWD Application
EWD 3 Training Course Part 5b: First Steps in Building a QEWD Application
 
EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...
EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...
EWD 3 Training Course Part 36: Accessing REST and Web Services from a QEWD ap...
 
EWD 3 Training Course Part 35: QEWD Session Locking
EWD 3 Training Course Part 35: QEWD Session LockingEWD 3 Training Course Part 35: QEWD Session Locking
EWD 3 Training Course Part 35: QEWD Session Locking
 
EWD 3 Training Course Part 34: QEWD Resilient Mode
EWD 3 Training Course Part 34: QEWD Resilient ModeEWD 3 Training Course Part 34: QEWD Resilient Mode
EWD 3 Training Course Part 34: QEWD Resilient Mode
 
EWD 3 Training Course Part 33: Configuring QEWD to use CORS
EWD 3 Training Course Part 33: Configuring QEWD to use CORSEWD 3 Training Course Part 33: Configuring QEWD to use CORS
EWD 3 Training Course Part 33: Configuring QEWD to use CORS
 
EWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPS
EWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPSEWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPS
EWD 3 Training Course Part 32: Configuring QEWD to use SSL/HTTPS
 
EWD 3 Training Course Part 29: Running QEWD as a Service
EWD 3 Training Course Part 29: Running QEWD as a ServiceEWD 3 Training Course Part 29: Running QEWD as a Service
EWD 3 Training Course Part 29: Running QEWD as a Service
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

EWD 3 Training Course Part 22: Traversing Documents using DocumentNode Objects

  • 1. Copyright © 2016 M/Gateway Developments Ltd EWD 3 Training Course Part 22 JavaScript Abstraction of Global Storage: (c) Traversing Documents Rob Tweed Director, M/Gateway Developments Ltd Twitter: @rtweed
  • 2. Copyright © 2016 M/Gateway Developments Ltd Traversing a Global Node using the cache.node order function: var node = { global: 'myGlobal', subscripts: ['d', 'e2', '' ] }; var subscript; do { subscript = db.order(node).result; if (subscript !== '') console.log(subscript); } while (subscript !== ''); myGlobal("d","e2","f1")="bar1" myGlobal("d","e2","f2")="bar2" myGlobal("d","e2","f3")="bar3" "f1", "f2", "f3" Traversal the hard way
  • 3. Copyright © 2016 M/Gateway Developments Ltd DocumentNode Object method: forEachChild() Traversal made easy and intuitive
  • 4. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes of a DocumentNode Object – ie through subscripts in underlying Global Storage
  • 5. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes – ie through subscripts in underlying Global Storage – docNode.forEachChild(function(nodeName, childNode) {…});
  • 6. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes – ie through subscripts in underlying Global Storage – docNode.forEachChild( function(nodeName, childNode) {…}) ; – Callback function fires on every iteration • ie every time a child node is found
  • 7. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes – ie through subscripts in underlying Global Storage – docNode.forEachChild(function(nodeName, childNode) {…}); Child node's Node Name (ie subscript)
  • 8. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes – ie through subscripts in underlying Global Storage – docNode.forEachChild(function(nodeName, childNode) {…}); Child node's Node Name (ie subscript) DocumentNode object representing the Child node
  • 9. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); forEachChild() Method
  • 10. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName) { // do something with the node name / subscript for this iteration }); forEachChild() Method
  • 11. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName) { // 1st iteration nodeName === 'f1’ }); forEachChild() Method
  • 12. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName) { // 2nd iteration nodeName === 'f2’ }); forEachChild() Method
  • 13. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName) { // 3rd iteration nodeName === 'f3’ }); forEachChild() Method
  • 14. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName) { console.log(nodeName); }); forEachChild() Method f1 f2 f3
  • 15. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // do something with the childNode DocumentNode object for this iteration }); forEachChild() Method
  • 16. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // do something with the childNode DocumentNode object for this iteration }); forEachChild() Method
  • 17. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // 1st iteration }); forEachChild() Method
  • 18. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // 2nd iteration }); forEachChild() Method
  • 19. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // 3rd iteration }); forEachChild() Method
  • 20. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // do something with the childNode DocumentNode object for this iteration }); forEachChild() Method childNode is a DocumentNode Object, so has all the usual properties and methods
  • 21. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { console.log(childNode.value); }); forEachChild() Method bar1 bar2 bar3
  • 22. Copyright © 2016 M/Gateway Developments Ltd forEachChild() Method • Iterates through all child nodes – docNode.forEachChild(function(nodeName, childNode) {…}); • Note that because ewd-document-store uses synchronous versions of underlying cache.node APIs, the call-backs fire in synchronous order • Additionally, the forEachChild() function will wait until completion before next command executes • This greatly simplifies its use!
  • 23. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); console.log('start…'); e2Node.forEachChild(function(nodeName, childNode) { console.log(childNode.value); }); console.log('end'); Example start… bar1 bar2 bar3 end
  • 24. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); console.log('start…'); e2Node.forEachChild(function(nodeName, childNode) { console.log(childNode.value); }); console.log('end'); Example This can be done safely because QEWD uses the master / worker architecture of ewd-qoper8 where your handler functions run on their own in an isolated process
  • 25. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); e2Node.forEachChild(function(nodeName, childNode) { // if callback function returns true (exit boolean flag), it stops the loop }); Stopping forEachChild() Early
  • 26. Copyright © 2016 M/Gateway Developments Ltd myDoc("d","e2","f1")="bar1" myDoc("d","e2","f2")="bar2" myDoc("d","e2","f3")="bar3" var e2Node = new this.documentStore.DocumentNode('myDoc', ['d', e2']); var count = 0; e2Node.forEachChild(function(nodeName, childNode) { count++; if (count === 3) return true; console.log(childNode.value); }); Stopping forEachChild() Early bar1 bar2
  • 27. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 28. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 29. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 30. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 31. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 32. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 33. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 34. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops Traversal of all nodes and subnodes
  • 35. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { // do something with child node });
  • 36. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { // 1st iteration });
  • 37. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { // 1st iteration childNode.forEachChild(function(nodeName, childNode) { // do something with grand-child node }); });
  • 38. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { // 1st iteration childNode.forEachChild(function(nodeName, childNode) { // 1st iteration }); });
  • 39. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { console.log(nodeName); childNode.forEachChild(function(nodeName, childNode) { console.log(childNode.value); }); });
  • 40. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nested forEachChild() loops var dNode = new this.documentStore.DocumentNode('myDoc', ['d']); dNode.forEachChild(function(nodeName, childNode) { console.log(nodeName); childNode.forEachChild(function(nodeName, childNode) { console.log(childNode.value); }); }); e1 bar1a bar2a e2 bar1b bar2b bar3b
  • 41. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Nest as deeply as you wish var doc = new this.documentStore.DocumentNode('myDoc'); doc.forEachChild(function(nodeName, childNode) { childNode.forEachChild(function(nodeName, childNode) { childNode.forEachChild(function(nodeName, childNode) { // do something with innermost node }); }); });
  • 42. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" forEachChild() in reverse order?
  • 43. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" forEachChild() in reverse order var myDoc = new this.documentStore.DocumentNode('myDoc', [ ]); myDoc.forEachChild( {direction: 'reverse'} , function(nodeName, childNode) { console.log(nodeName); }); Use optional control object argument
  • 44. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" forEachChild() in reverse order var myDoc = new this.documentStore.DocumentNode('myDoc', [ ]); myDoc.forEachChild( {direction: 'reverse'} , function(nodeName, childNode) { console.log(nodeName); }); d b a
  • 45. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes
  • 46. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes
  • 47. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc');
  • 48. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc'); console.log(myDoc.firstChild.value); // 123 firstChild returns a DocumentNode object
  • 49. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc'); console.log(myDoc.firstChild.value); // 123 console.log(myDoc.firstChild.name); // a firstChild returns a DocumentNode object
  • 50. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc'); console.log(myDoc.lastChild.name); // d lastChild also returns a DocumentNode object
  • 51. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc'); console.log(myDoc.firstChild.nextSibling.name); // b nextSibling returns a DocumentNode object
  • 52. Copyright © 2016 M/Gateway Developments Ltd myDoc("a")=123 myDoc("b","c1")="foo" myDoc("b","c2")="foo2" myDoc("d","e1","f1a")="bar1a" myDoc("d","e1","f2a")="bar2a" myDoc("d","e2","f1b")="bar1b" myDoc("d","e2","f2b")="bar2b" myDoc("d","e2","f3b")="bar3b" Navigating to Specific Nodes var myDoc = new this.documentStore.DocumentNode('myDoc'); console.log(myDoc.lastChild.previousSibling.name); // b previousSibling returns a DocumentNode object