MarkLogic Node.js Client API
MarkLogic is a document database built from the ground up for managing heterogenous data. It stores and indexes JSON (and XML) natively and combines a complete JavaScript stored procedure environment and HTTP server, making it ideal for modern, full-stack JavaScript applications.
MarkLogic is used today in production on hundreds of mission-critical applications across different industries and the public sector. It provides the flexibility and scalability of NoSQL, without having to compromise on reliability and consistency that organizations have come to depend on with relational databases. Unlike most other NoSQL databases, MarkLogic offers ACID transactions—multi-document, multi-statement, and even XA—along with a rich set of built-in indexes, granular role-based security, and a shared-nothing architecture for scalability and high availability.
The MarkLogic Node.js Client API is the easiest way to integrate MarkLogic into a Node.js application. Installed from npm, it gives developers a fully asynchronous JavaScript API for document management, query, aggregates, and extensibility with JavaScript that runs in the database, close to the data.
Node.js Client API on GitHub ›
var marklogic = require('marklogic'); var conn = require('./env.js').connection; // Host and auth details var db = marklogic.createDatabaseClient(conn); var q = marklogic.queryBuilder; db.documents.query( q.where( q.collection('countries'), q.value('region', 'Africa'), q.or( q.word('background', 'France'), q.word('Legal system', 'French') ) ) ).result(function(documents) { documents.forEach(function(document) { console.log(JSON.stringify(document)); }); });
Focus on application features rather than plumbing with out-of-the-box features
- Find what you're looking for with powerful, flexible search
- Keep data safe with ACID transactions
- Understand your data with aggregate functions
- Follow changes through alerting
- Localize searches with geospatial features
Move faster to production with proven reliability at scale
- Be there when your customers need you with high availability
- Scale out with a shared-nothing cluster architecture
- Control costs with tiered storage
- Control who sees what with robust security
Maximize performance and flexibility—bringing code to the data
- Simplify data management with native JSON storage
- Extensibility to push code close to the data
- Get rapid responses with powerful indexes
Enable modern end-to-end JavaScript development
- Benefit from built-in features, extend the API for your logic
- Avoid transformations by using the same data structures throughout application
Always open source on GitHub
- Request features and fixes
- Accelerate tool development by contributing enhancements
Quick Start
- install MarkLogic
- $ npm install --save marklogic
- var ml = require('marklogic');
- var db = ml.createConnection({ "host": "localhost", "port": 8000, "user": "admin", "password": "admin", "authType": "DIGEST" });
- Details in the Getting Started section of the Node.js Application Developer's Guide
Next Steps
- Node.js Client API on GitHub
- Node.js Application Developer's Guide
- MarkLogic University's free MarkLogic Fundamentals course