Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting multiple entities with just one results in crash #7

Open
oander11 opened this issue Feb 17, 2021 · 0 comments
Open

Getting multiple entities with just one results in crash #7

oander11 opened this issue Feb 17, 2021 · 0 comments

Comments

@oander11
Copy link

Using the following cache:

const cache = new NsqlCache({
    db: dsAdapter(datastore),
    stores: [
    {
        store: redisStore,
        host: REDISHOST, 
        port: REDISPORT
    }],
});

and then fetching two entities works fine:

const keys = [
  datastore.key(['Company', 123]),
  datastore.key(['Product', 'Computer'])
];

datastore.get(keys, (err, entities) => {});

But if you use an array but just have one item inside it:

const keys = [
  datastore.key(['Company', 123])
];

you get the following exception:

TypeError: Cannot read property 'join' of undefined
    at keyToString (/x/node_modules/nsql-cache-datastore/lib/index.js:99:29)
    at Object._db.keyToString.key [as keyToString] (/x/node_modules/nsql-cache/lib/index.js:171:61)
    at keyToString (/x/node_modules/nsql-cache/lib/keys.js:17:60)
    at Object.read (/x/node_modules/nsql-cache/lib/keys.js:68:65)
    at Datastore.ds.get (/x/node_modules/nsql-cache-datastore/lib/index.js:184:35)
    at require.ProviderController.get (x/src/js/controllers/providerController.js:47:31)
    at Layer.handle [as handle_request] (/x/node_modules/express/lib/router/layer.js:95:5)
    at next (/x/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/x/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/x/node_modules/express/lib/router/layer.js:95:5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant