Module: 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) → {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 or basic
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
Returns:
a client for accessing the database as the user
Type
DatabaseClient

<static> patchBuilder() → {patchBuilder}

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

<static> queryBuilder() → {queryBuilder}

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

<static> setSliceMode(mode)

Configures the slice clause 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 "legacy" at present but will become "array" in the next major release.
Parameters:
Name Type Description
mode string "array" or "legacy"

<static> valuesBuilder() → {valuesBuilder}

A factory for creating a values builder
Returns:
a helper for defining a query to project tuples (rows) of values from documents
Type
valuesBuilder