@medable/mdctl-api-driver

1.0.72 • Public • Published

mdctl-api-driver :: DB Driver Module

Developer Tools Driver module

This module provides the access to the db driver endpoints

How to use

const { Client } = require('@medable/mdctl-api')
const { Driver } = require('@medable/mdctl-api-driver')
const { CortexObject } = require('@medable/mdctl-api-driver/lib/cortex.object')

// a global org object will be created using the default mdctl credentials

const result = await org.objects.c_my_object.find() // will return a Transform stream.
const result = await org.objects.c_my_object.find().toArray() // will return an array with results

// using bulk operations

const result = await org.objects.bulk()
    .add(org.objects.c_my_object.inserOne({}), {
        name: 'InserOne',
        halt: true,
        wrap: true,
        output: true
    })
    .add(org.objects.c_my_object.find({c_name: 'test'}), {
         name: 'Results',
         halt: true,
         wrap: true,
         output: true
     })
     .toArray()


// In case you want to use a different credentials/environment

const driver = new Driver(new Client({environment, credentials}))
const obj = new CortexObject('c_my_object', driver)

const result = await obj.find({c_name: 'test'})

Readme

Keywords

none

Package Sidebar

Install

npm i @medable/mdctl-api-driver

Weekly Downloads

290

Version

1.0.72

License

MIT

Unpacked Size

35.8 kB

Total Files

7

Last publish

Collaborators

  • harishva
  • myerkes-md
  • cscherer-md
  • __jacobi
  • jamessas
  • trsmith
  • grobledo
  • oferrero.medable