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, token) → {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|basic|certificate|kerberos|saml 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 castring | Array.<string> | Buffer | Array.<Buffer> <optional>
the trusted certificate(s), if required for SSL keystring | Buffer <optional>
the private key to use for SSL certstring | Buffer <optional>
the public x509 certificate to use for SSL pfxBuffer <optional>
the public x509 certificate and private key as a single PKCS12 file to use for SSL passphrasestring <optional>
the passphrase for the PKCS12 file tokenstring <optional>
the SAML token to use for authentication with the REST server - 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> planBuilder() → {planBuilder}
-
A factory for creating a rows plan builder.
- Since:
-
- 2.4
Returns:
a helper for defining a rows query- Type
- planBuilder
-
-
<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 modestring "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