0

I installed GridDB 5.7 and am trying to use the Node.js client to create a store object. My code is:

Input:

const griddb = require('griddb-node');

const factory = griddb.StoreFactory.createStore({
    host: '127.0.0.1',
    port: 10001,
    clusterName: 'defaultCluster',
    username: 'admin',
    password: 'admin'
});

console.log(factory);

When I run

node test.js

I get:

TypeError: griddb.StoreFactory.createStore is not a function

I’ve also tried:

griddb.StoreFactory.getStore()
griddb.StoreFactory.get()

…but they all fail with similar errors..

The official GridDB Node.js docs mention createStore / getStore methods, but my installation doesn’t seem to have them

Environment:

  • WSL Ubuntu 22.04

  • Node.js: 16.x

  • GridDB: 5.7

What I want to know:
What is the correct way to create a store object using the Node.js client for GridDB 5.7

New contributor
Md Salimullah is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
3
  • Thanks for your comment! I also tried: const factory = griddb.StoreFactory.getInstance(); const store = factory.getStore({ options }); But I get the same error: TypeError: griddb.StoreFactory.getInstance is not a function So in my installation: =>createStore() → not found =>getStore() → not found =>getInstance() → not found It looks like StoreFactory itself has no functions. Commented Nov 16 at 1:22
  • Did you try to console.log the factory and see what it has? Commented Nov 16 at 14:16
  • Did you try to log what griddb/griddb.StoreFactory returns? console.log(griddb) Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.