Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marklogic

Package Overview
Dependencies
Maintainers
4
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marklogic

The official MarkLogic Node.js client API.

  • 2.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
325
decreased by-21.5%
Maintainers
4
Weekly downloads
 
Created
Source

MarkLogic Node.js Client API

The MarkLogic Node.js Client API provides access to the MarkLogic database from Node.js applications.

Features

  • Writing, reading, patching, and deleting documents in JSON, XML, text, or binary formats
  • Querying over documents including parsing string queries, extracting properties, and calculating facets
  • Projecting tuples (like table rows) out of documents
  • Single transactions and multi-statement transactions for database changes
  • Writing, reading, and deleting graphs and executing SPARQL queries over graphs
  • Extending the built-in services or evaluating or invoking your own JavaScript or XQuery on the server
  • Basic, digest, certificate, and Kerberos authentication

Getting Started

You can install the marklogic package as a dependency for your Node.js project using npm:

npm install marklogic --save

With the marklogic package installed, the following inserts two documents in a collection into the Documents database using MarkLogic's built-in REST server at port 8000:

var marklogic = require('marklogic');

var db = marklogic.createDatabaseClient({
  host:     'localhost',
  port:     '8000',
  database: 'Documents',
  user:     'admin',
  password: 'admin',
  authType: 'DIGEST'
});

db.createCollection(
  '/books',
  {author: 'Beryl Markham', ...},
  {author: 'WG Sebald',     ...}
  )
.result(function(response) {
    console.log(JSON.stringify(response, null, 2));
  }, function (error) {
    console.log(JSON.stringify(error, null, 2));
  });

Resources

Code Examples

The Node.js Client API ships with code examples to supplement the examples in the online resources. To run the examples, follow the instructions here:

examples/1readme.txt

Generating Documentation Locally

After installing the project dependencies (including the gulp build system), you can build the reference documentation locally from the root directory of the marklogic package:

gulp doc

The documentation is generated in a doc subdirectory. The documentation can also be accessed online here.

Running Tests

To set up the database and REST server for tests, execute the following command from the root directory for the marklogic package:

node etc/test-setup.js

After setup, you can run tests for the Node.js Client API with the following command:

gulp test

To tear down the test database and REST server, execute the following:

node etc/test-teardown.js

Support

The MarkLogic Node.js Client API is maintained by MarkLogic Engineering. It is designed for use in production applications with MarkLogic Server. Everyone is encouraged to file bug reports, feature requests, and pull requests through GitHub. This input is critical and will be carefully considered, but we can’t promise a specific resolution or timeframe for any request. In addition, MarkLogic provides technical support for release tags of the Node.js Client API to licensed customers under the terms outlined in the Support Handbook. For more information or to sign up for support, visit help.marklogic.com.

Keywords

FAQs

Package last updated on 11 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc