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 hoststring <optional>
localhost the host with the REST server for the database portnumber <optional>
8000 the port with the REST server for the database databasestring <optional>
the name of the database to access, defaulting to the database for the AppServer on the port userstring the user with permission to access the database passwordstring the password for the user with permission to access the database authTypeenum <optional>
digest the authentication type of digest or basic sslboolean <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. agentobject <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 modestring "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