Mongoose cannot store

  node.js, question

The problem with using mongoose to store data is that I did not report an error, but I did not save the data and could not find the problem.

Before, when trying to store, a warning popped up:

Said that the promise will be removed and asked me to insert it into my Promise library.



Then, the stored logic is


NewComment is the data to be stored, cb and fb are callback functions after success and failure
However, because it has not been stored, I did not call it first.

DAO is like this



After exporting the newly created model, the storage logic is implemented

The reason is not asynchronous

But on schema.pre

Next () must be called before storage