1.1.7 • Published 12 months ago

opensearch-sequelize v1.1.7

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

opensearch-sequelize

Sequelize-like promise-based Node.js ORM tool for OpenSearch.

Installation

The package is connected via npm.

npm i opensearch-sequelize

Using

Create model:

import { Table, Model } from "opensearch-sequelize";

@Table({ tableName: "movies" })
export class Movies extends Model {
  name!: string;
  year!: number;
  nextPart?: string;
}

Connect:

const sequelize = new Sequelize({
  host: "https://localhost:9200",
  username: "admin",
  password: "admin",
});

Using model:

const movies = await Movies.findAll({
  limit: 2,
  offset: 0,
  where: {
    name: { type: "fuzzy", value: "Matrix" },
    year: 1999,
  },
});

If methods doesn't provide necessary functionality, then use raw requests:

// GET /movies/_search with query
const data = await Movies.queryGet("_search", query);

Examples

You can find examples of using methods here.

1.1.7

12 months ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago