How to use the marklogic.createDatabaseClient function in marklogic

To help you get started, we’ve selected a few marklogic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lonhutt / mlrepl / scripts / install.js View on Github external
try{
    
    if(fs.statSync(configFile).isFile()){
      return JSON.parse(fs.readFileSync(configFile));
    } else {
      return false;
    }

  } catch(e){
    return false;
  }
}

var mlconfig = getConfig()

var db = marklogic.createDatabaseClient({
  host: mlconfig.host,
  port: '8000',
  user: mlconfig.username,
  password: mlconfig.password,
  database: 'Modules',
  authType: 'DIGEST'
});

var mlauth = {user:mlconfig.username, pass:mlconfig.password, sendImmediately:false};

var buffer = [];
var upload = function(path){

  var collection = undefined;
  if(path.indexOf('docs') > -1){
    collection = path.split('/').slice(-1)[0].split('.')[0];
github koopjs / koop-provider-marklogic / src / koop / query.js View on Github external
function MarkLogicQuery() {
  this.conn = config.marklogic.connection;
  this.db = marklogic.createDatabaseClient(this.conn);
}
github mikrovvelle / mlxprs / client / marklogicClient.ts View on Github external
constructor(params: MlClientParameters) {
        this.params = params
        this.params.authType = params.authType.toUpperCase()

        this.docsDbNumber = '0'
        if (params.pathToCa !== '') {
            try {
                this.ca = fs.readFileSync(this.params.pathToCa, 'utf8')
            } catch (e) {
                throw new Error('Error reading CA file: ' + e.message)
            }
        }
        if (this.params.authType !== 'DIGEST' && this.params.authType !== 'BASIC') {
            this.params.authType = 'DIGEST'
        }
        this.mldbClient = ml.createDatabaseClient({
            host: this.params.host, port: this.params.port,
            user: this.params.user, password: this.params.pwd,
            authType: this.params.authType, ssl: this.params.ssl,
            ca: this.ca
        })
        this.mldbClient.eval('xdmp.database("' + this.params.contentDb + '")')
            .result(null, null).then((response) => {
                this.docsDbNumber = response[0]['value']
            })
    }
github marklogic-community / marklogic-samplestack / appserver / node-express / lib / db-client / index.js View on Github external
var getClient = function (user, password) {
  return mlclient.createDatabaseClient(_.merge(
    options.middleTier.db.clientConnection,
    {
      user: user,
      password: password
    }
  ));
};