MarkLogic Server 11.0 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!"
// }
Powered by MarkLogic Server | Terms of Use | Privacy Policy