Skip to content

A functional-models-orm datastore provider that uses Elasticsearch or Opensearch.

License

Notifications You must be signed in to change notification settings

monolithst/functional-models-orm-elastic

Repository files navigation

Functional Models ORM Elastic

Unit Tests Coverage Status

How To Install

npm install functional-models-orm-elastic

How To Use

import { createOrm } from 'functional-models'
import { datastoreAdapter as elasticDatastore } from 'functional-models-orm-elastic'
import { Client } from '@opensearch-project/opensearch'

// Create your client.
const client = new Client({
  node: 'http://localhost:9200',
})

// Create datastoreAdapter
const datastoreAdapter = elasticDatastore.create({
  client,
})

// Create an orm for use with your models.
const orm = createOrm({ datastoreAdapter })

Notes on Running with AWS OpenSearch

One way to use the client is with a username/password and the elastic url.

Here is an example:

const url = `https://${elasticUsername}:${elasticPassword}@${elasticUrl}`

const client = new Client({
  node: url,
})

About

A functional-models-orm datastore provider that uses Elasticsearch or Opensearch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published