serverless-cqrs
  • Introduction
  • Quickstart
  • Domain
  • Testing
  • Examples
    • Express
    • GraphQL
  • Advanced
    • Adapter Interface
      • Write Model
      • Read Model
    • Deploy
    • Authorization
    • Eventual Consistency
    • Multiple Aggregates
  • Components
    • serverless-cqrs
    • write-model
      • repositoryBuilder
      • commandServiceBuilder
    • read-model
    • memory-adapter
    • dynamodb-adapter
    • elasticsearch-adapter
Powered by GitBook
On this page
  • Methods
  • build
  • Example

Was this helpful?

  1. Components

elasticsearch-adapter

Previousdynamodb-adapter

Last updated 6 years ago

Was this helpful?

A library that implements the Adapter interface for storing projections on AWS ElasticSearch.

Methods

build

build({ entityName }, { endpoint )

builds a read-model adapter

Parameters

attribute

type

description

entityName

string

the name of the entity

endpoint

string

the ElasticSearch instance endpoint url

Returns

an object with

Example

adapter.js
const elasticAdapterBuilder = require('serverless-cqrs.elasticsearch-adapter')
module.exports = elasticAdapterBuilder.build({ 
  entityName: 'todo'
}, {
  endpoint: 'https://xxxxxx.yyy/zzzz/1234',
})
Read Model
read model methods