loopback icon indicating copy to clipboard operation
loopback copied to clipboard

The KeyValueModel has not been correctly attached to a DataSource!

Open iRajul opened this issue 9 years ago • 2 comments

I am trying to set data in boot script but i am getting error.

Error: Cannot call DataSet.keys(). The keys method has not been setup. The KeyValueModel has not been correctly attached to a DataSource!

module.exports = function(app, callback) { var DataSet = app.models.DataSet; DataSet.set("key", "value", function(err, response) {});

Description/Steps to reproduce

Error: Cannot call cronDataSet.keys(). The keys method has not been setup. The KeyValueModel has not been correctly attached to a DataSource!

Expected result

Additional information

iRajul avatar Jun 11 '17 14:06 iRajul

@iRajul The KeyValueModel has not been correctly attached to a DataSource! Well, then, let's make sure it's correctly attached. For example, here is a test code which does that: https://github.com/strongloop/loopback/blob/master/test/key-value-model.test.js#L145

Setogit avatar Jun 12 '17 18:06 Setogit

Please submit a new issue if needed. closing one month or older issues. thanks!

Setogit avatar Jul 21 '17 20:07 Setogit