I am trying to discover the models in an oracle database with loopback as the documentation says but I do not know how to generate the .json models, they know of some example, in the documentation it says that it should be used with fs.writeFile()
but not the example is shown, I am using the following to connect me
var loopback = require('loopback');
var ds = loopback.createDataSource('oracle', {
"host": "oracle.local",
"port": 1521,
"database": "XE",
"password": "password",
"user": "user",
});
function schemaCallback(err, schema) {
if (err) {
console.error(err);
}
console.log(schema)
}
// Discover and build models from INVENTORY table
ds.discoverAndBuildModels('VISION', {owner:'owner', relations: true, all:true , associations:true}, schemaCallback);