Skip to content

Error: Cannot find module '../data-sources/db' #1791

@wzup

Description

@wzup

I want to perform Auto-migrate my models to my MongoDB database. I read this docs https://docs.strongloop.com/display/public/LB/Creating+a+database+schema+from+models

There is a code example.

var ds = require('../data-sources/db')('oracle');
var Customer = require('../models/customer');
ds.createModel(schema_v1.name, schema_v1.properties, schema_v1.options);

ds.automigrate(function () {
  ds.discoverModelProperties('CUSTOMER_TEST', function (err, props) {
    console.log(props);
  });
});

I copy it and change a little to mongodb instead of oracle and I get error Cannot find module '../data-sources/db':

var ds = require('../data-sources/db')('mongodb');

How to perform an auto-migration?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions