Loading TOC...

MarkLogic 9 Product Documentation
NodeBuilder.addNode

NodeBuilder.addNode(
   node as Node
) as This NodeBuilder object

Summary

Add a node to the node tree the builder is building.

Parameters
node The node to add.

Example

const builder = new NodeBuilder();
builder.addNode(
  { lat: 12.2,
    long: -122.45,
    handle: '@johnqpublic',
    text: 'Here is my first tweet!'
  }
);
builder.toNode();

// Returns a JSON object node equivalent to the following:
//
// { "lat":12.2, 
//   "long":-122.45, 
//   "handle":"@johnqpublic", 
//   "text":"Here is my first tweet!"
// }

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.