Registry / database / query-orm-connector-elastic

query-orm-connector-elastic

JSON →
library1.0.3jsnpmunverified

Elasticsearch 7.x connector for query-orm (v1.0.3). Enables use of Elasticsearch as a data source with the query-orm framework, supporting index management, mappings, aliases, and CRUD operations. Released as a standalone package requiring query-orm as a peer dependency. Differentiates from other Elasticsearch ORMs by integrating with query-orm's model-based abstraction and event-driven lifecycle. Low release cadence; last updated 2019.

npm install query-orm-connector-elastic
INSTALL
IMPORT
SIG · QUERY-ORM-CONNECTO
Q
query-orm-connector-elastic
databasejavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QueryORM
✓ const QueryORM = require('query-orm');
✗ import QueryORM from 'query-orm';
Package uses CommonJS; ESM imports may fail in Node <14 unless using a bundler.
none
✓ The connector is a plugin; no direct import from the package itself. The connector is specified in datasources.json.
✗ const connector = require('query-orm-connector-elastic');
Do not require or import this package directly in application code. It is loaded automatically by query-orm based on datasource configuration.

Connects to Elasticsearch via query-orm, defines a User model, creates a user, and queries by username.

const QueryORM = require('query-orm'); const path = require('path'); const app = new QueryORM({ appRoot: __dirname, modelConfig: './model-config.json', dataSources: './datasource.json' }); app.on('model-init', (data) => { console.log('Models initialized:', data); }); app.on('error', (error) => { console.error('App error:', error); }); async function run() { const createdUser = await app.models.User.create({ firstname: 'Jane', lastname: 'Doe', username: 'janedoe', password: 'Pass123!' }); console.log('Created user:', createdUser); const users = await app.models.User.find({ where: { username: 'janedoe' } }); console.log('Found users:', users); } run().catch(err => console.error(err));
Debug
Known issues
breakingElasticsearch version compatibility: v7 only. Does not support ES 6.x or 8.x.
fix
Use Elasticsearch 7.x cluster or upgrade connector if newer version available.
affects: all
gotchaThe connector is not imported directly; it must be installed and referenced in datasources.json. Failing this will result in missing connector error.
fix
Ensure both query-orm and query-orm-connector-elastic are installed, and datasources.json includes 'connector': 'query-orm-connector-elastic'.
affects: all
deprecatedThe package uses the elasticsearch npm client (deprecated). The @elastic/elasticsearch client is the recommended replacement.
fix
No official migration path. Consider using a more modern connector or custom integration.
affects: all
gotchaSSL configuration: setting rejectUnauthorized: false disables certificate validation. Not recommended for production.
fix
Provide proper CA certificate or secure connection in production.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'query-orm'
query-orm is not installed; it is a required peer dependency.
fix
npm install query-orm
Error: The connector query-orm-connector-elastic is not registered.
The connector package is not installed or not properly configured in datasources.json.
fix
npm install query-orm-connector-elastic and ensure datasources.json has the correct connector name.
ConnectionError: No Living connections
Elasticsearch cluster is not reachable or connection configuration is incorrect.
fix
Check datasources.json > configuration > nodes for correct URL and port. Ensure Elasticsearch is running.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
query-ormrequiredRequired peer dependency — the connector is useless without the query-orm core framework.
Agent activity
10 hits · last 30 days
node
8
Anthropic
1
Resources
query-orm-connector-elastic — npm install query-orm-connector-elastic · libregistry