Namespace: marklogic

marklogic

Provides functions to connect to a MarkLogic database and to build requests for the database.

Methods


<static> createDatabaseClient(host, port, database, user, password, authType, ssl, agent, ca, key, cert, pfx, passphrase) → {DatabaseClient}

Creates a database client to make database requests such as writes, reads, and queries. The constructor takes a configuration object with the following named parameters.
Parameters:
Name Type Argument Default Description
host string <optional>
localhost the host with the REST server for the database
port number <optional>
8000 the port with the REST server for the database
database string <optional>
the name of the database to access, defaulting to the database for the AppServer on the port
user string the user with permission to access the database
password string the password for the user with permission to access the database
authType enum <optional>
digest the authentication type of digest|basic|certificate|kerberos
ssl boolean <optional>
false whether the REST server uses SSL; when true, the connection parameters can include the supplemental HTTPS options specifiable for the node.js tls.connect() function.
agent object <optional>
defaults to a connection pooling agent
ca string | Array.<string> | Buffer | Array.<Buffer> <optional>
the trusted certificate(s), if required for SSL
key string | Buffer <optional>
the private key to use for SSL
cert string | Buffer <optional>
the public x509 certificate to use for SSL
pfx Buffer <optional>
the public x509 certificate and private key as a single PKCS12 file to use for SSL
passphrase string <optional>
the passphrase for the PKCS12 file
Since:
  • 1.0
Returns:
a client for accessing the database as the user
Type
DatabaseClient

<static> patchBuilder() → {patchBuilder}

A factory for creating a document patch builder
Since:
  • 1.0
Returns:
a helper for defining a document patch
Type
patchBuilder

<static> queryBuilder() → {queryBuilder}

A factory for creating a document query builder.
Since:
  • 1.0
Returns:
a helper for defining a document query
Type
queryBuilder

<static> setSliceMode(mode)

Configures the slice mode of the query builder and values builder to conform to Array.prototype.slice(begin, end) where begin is zero-based or legacy slice(pageStart, pageLength) where pageStart is one-based. The default is array slice mode. Legacy slice mode is deprecated and will be removed in the next major release.
Parameters:
Name Type Description
mode string "array" or "legacy"
Since:
  • 1.0

<static> valuesBuilder() → {valuesBuilder}

A factory for creating a values builder
Since:
  • 1.0
Returns:
a helper for defining a query to project tuples (rows) of values from documents
Type
valuesBuilder
Copyright 2014-2017 MarkLogic Corporation Documentation generated by JSDoc 3.4.3 on 2017-10-30T13:10:55-07:00 using the DocStrap template.