diff --git a/lib/model.js b/lib/model.js index 8d9666df0ef..823434e2edb 100644 --- a/lib/model.js +++ b/lib/model.js @@ -1671,9 +1671,7 @@ Model.listIndexes = async function listIndexes() { * * #### Example: * - * Event.ensureIndexes(function (err) { - * if (err) return handleError(err); - * }); + * await Event.ensureIndexes(); * * After completion, an `index` event is emitted on this `Model` passing an error if one occurred. * @@ -1684,7 +1682,7 @@ Model.listIndexes = async function listIndexes() { * * Event.on('index', function (err) { * if (err) console.error(err); // error occurred during index creation - * }) + * }); * * _NOTE: It is not recommended that you run this in production. Index creation may impact database performance depending on your load. Use with caution._ *