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 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|saml|cloud 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 token
string <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> ctsQueryBuilder() → {ctsQueryBuilder}
-
A factory for creating a cts query builder.
- Since:
-
- 2.7.0
Returns:
a helper for defining a cts query- Type
- ctsQueryBuilder
-
-
<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> releaseClient(MarkLogicClient)
-
Releases the client and destroys the agent.
Parameters:
Name Type Description MarkLogicClient
- Since:
-
- 3.0.0
-
-
<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