Giter Club home page Giter Club logo

node-client-api's Introduction

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, Kerberos, and SAML authentication
  • Import libraries as JavaScript mjs modules
  • Data Services First - MarkLogic's support for microservices
  • Optic query DSL, document matching, relevance, multiple groups
  • Generate query based views, redaction on rows
  • Data Movement SDK - move large amounts of data into, out of, or within a MarkLogic cluster

Getting Started

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

npm install marklogic --save

For Windows OS please use the below for Node Client 2.9.1:

npm install marklogic --save --ignore-scripts

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:

npm run 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:

npm run test:setup

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

npm test

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

npm run test:teardown

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.

node-client-api's People

Contributors

ehennum avatar wooldridge avatar anu3990 avatar mayankbhatnagar89 avatar gvaidees avatar georgeajit avatar kkanthet avatar jmakeig avatar ayuwono avatar andreipanti avatar elliotttf avatar hansenmc avatar cpisoiu avatar dmcassel avatar sameerapriyathamtadikonda avatar kcoleman-marklogic avatar iambrianchan avatar pete-otaqui avatar itsshivaverma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.