B
B
bro-dev2018-04-22 11:45:31
JavaScript
bro-dev, 2018-04-22 11:45:31

Is the path to the models hardcoded somewhere in mongus?

console.dir(1);
var Paymentid = require(__dirname + '/admin/server/models/Paymentid.js');

Paymentid.find({}, function() {
  console.dir(arguments);
});
console.dir(3);

Why does this code not work, and if you change it to
var Paymentid = require(__dirname + '/models/Paymentid.js');

and accordingly copy the folder, then everything will be fine. Is it really that the way to the models is rigidly laid somewhere for Mongus? The problem is definitely not with the rights. It doesn’t work, it means nothing happens at all, no answer, no hello. not errors, but if this is wrapped in async c await, then on the find line it will simply hang endlessly, after 5-25 minutes it will fall off by timeout, did not check.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question