UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

892 lines (565 loc) 33.7 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl" href="../../../../"> <title data-ice="title">Seeder | mongoose-data-seed</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> <meta name="description" content="Seed mongodb with data using mongoose models"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="mongoose-data-seed"><meta property="twitter:description" content="Seed mongodb with data using mongoose models"></head> <body class="layout-container" data-ice="rootContainer"> <header> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <a href="test.html" data-ice="testLink">Test</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> <a style="position:relative; top:3px;" href="https://github.com/sharvit/mongoose-data-seed"><img width="20px" src="./image/github.png"></a></header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib">lib</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-config">config</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-configFilename">configFilename</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-defaultUserGeneratorConfig">defaultUserGeneratorConfig</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-systemConfigTemplate">systemConfigTemplate</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-systemSeederTemplate">systemSeederTemplate</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-commands">lib/commands</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-aliasToCommand">aliasToCommand</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-commandToFunction">commandToFunction</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCommandAndArgvFromCli">getCommandAndArgvFromCli</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isAlias">isAlias</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-runCommand">runCommand</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-aliases">aliases</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-availableCommandsList">availableCommandsList</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-commands">commands</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-commandsMap">commandsMap</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-defaultCommand">defaultCommand</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-commands-generate">lib/commands/generate</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateSeeder">generateSeeder</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-help">help</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-index">index</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getOptions">getOptions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validateOptions">validateOptions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-optionDefinitions">optionDefinitions</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-commands-help">lib/commands/help</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-help">help</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-usageGuide">usageGuide</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-commands-init">lib/commands/init</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/commands/init/installer-logger.js~InstallerLogger.html">InstallerLogger</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-help">help</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-index">index</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getOptions">getOptions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-promptMissingOptions">promptMissingOptions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-runinstaller">runinstaller</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-optionDefinitions">optionDefinitions</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-commands-run">lib/commands/run</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/commands/run/run-logger.js~RunLogger.html">RunLogger</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-help">help</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-index">index</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getOptions">getOptions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-run">run</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-optionDefinitions">optionDefinitions</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-usageGuide">usageGuide</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-core">lib/core</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/core/installer-error.js~InstallerError.html">InstallerError</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/core/installer.js~Installer.html">Installer</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/core/md-seed-runner-error.js~MdSeedRunnerError.html">MdSeedRunnerError</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/core/md-seed-runner.js~MdSeedRunner.html">MdSeedRunner</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/core/seeder-generator.js~SeederGenerator.html">SeederGenerator</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-InstallerConfig">InstallerConfig</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#lib-utils">lib/utils</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/utils/base-logger.js~BaseLogger.html">BaseLogger</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html">Seeder</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-exit">exit</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getFolderNameFromPath">getFolderNameFromPath</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getObjectWithSelectedKeys">getObjectWithSelectedKeys</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-normalizeSeederFileName">normalizeSeederFileName</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-normalizeSeederName">normalizeSeederName</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validateSeederTemplatePath">validateSeederTemplatePath</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validateSeedersFolderName">validateSeedersFolderName</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validateUserConfig">validateUserConfig</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-ExitCodes">ExitCodes</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><div class="header-notice"> <div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import Seeder from &apos;<span><a href="file/src/lib/utils/seeder.js.html#lineNumber41">mongoose-data-seed/src/lib/utils/seeder.js</a></span>&apos;</code></pre></div> <span data-ice="access">public</span> <span data-ice="kind">class</span> <span data-ice="source">| <span><a href="file/src/lib/utils/seeder.js.html#lineNumber41">source</a></span></span> </div> <div class="self-detail detail"> <h1 data-ice="name">Seeder</h1> <div class="description" data-ice="description"><p>Base class for seeders to extend.</p> <p>Seeder is an Abstract base class in order to use Seeder you need to extend Seeder into your own class and implement async run() method</p> </div> <div data-ice="exampleDocs"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">import { Seeder } from &apos;mongoose-data-seed&apos;; import { User } from &apos;../server/models&apos;; const data = [ { email: &apos;user1@gmail.com&apos;, password: &apos;123123&apos;, passwordConfirmation: &apos;123123&apos;, isAdmin: true, }, { email: &apos;user2@gmail.com&apos;, password: &apos;123123&apos;, passwordConfirmation: &apos;123123&apos;, isAdmin: false, }, ]; class UsersSeeder extends Seeder { async shouldRun() { const count = await User.countDocuments().exec(); return count === 0; } async run() { return User.create(data); } } export default UsersSeeder;</code></pre> </div> </div> </div> <div data-ice="staticMethodSummary"><h2>Static Method Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Static Public Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#static-method-extend">extend</a></span></span><span class="code" data-ice="signature">(userSeederMethods: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="class/src/lib/utils/seeder.js~Seeder.html">Seeder</a></span></span> </p> </div> <div> <div data-ice="description"><p>Creates a new seeder by extending the base seeder.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-constructor-constructor">constructor</a></span></span><span class="code" data-ice="signature">()</span> </p> </div> <div> <div data-ice="description"><p>Abstract class can not be constructed.</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary"> <thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead> <tbody> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="async">async</span> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-method-beforeRun">beforeRun</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span> </p> </div> <div> <div data-ice="description"><p>To perform before run.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-method-getStats">getStats</a></span></span><span class="code" data-ice="signature">(results: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span> </p> </div> <div> <div data-ice="description"><p>Get stats from seed results.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="async">async</span> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-method-run">run</a></span></span><span class="code" data-ice="signature">()</span> </p> </div> <div> <div data-ice="description"><p>Run the seeder.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="async">async</span> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-method-seed">seed</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span> </p> </div> <div> <div data-ice="description"><p>Seed the data.</p> </div> </div> </td> <td> </td> </tr> <tr data-ice="target"> <td> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="override" data-ice="override"></span> </td> <td> <div> <p> <span data-ice="async">async</span> <span class="code" data-ice="name"><span><a href="class/src/lib/utils/seeder.js~Seeder.html#instance-method-shouldRun">shouldRun</a></span></span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span> </p> </div> <div> <div data-ice="description"><p>Should run</p> </div> </div> </td> <td> </td> </tr> </tbody> </table> </div> <div data-ice="staticMethodDetails"><h2 data-ice="title">Static Public Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="static-method-extend"> <span class="access" data-ice="access">public</span> <span data-ice="static">static</span> <span class="code" data-ice="name">extend</span><span class="code" data-ice="signature">(userSeederMethods: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="class/src/lib/utils/seeder.js~Seeder.html">Seeder</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber136">source</a></span></span> </span> </h3> <div data-ice="description"><p>Creates a new seeder by extending the base seeder. Useful when not using old javascript</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">userSeederMethods</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td> <td data-ice="appendix"><ul><li>optional</li> <li>default: {}</li></ul></td> <td data-ice="description"><p>Object with the seeders method (e.g. run, shouldRun, beforeRun ...)</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="class/src/lib/utils/seeder.js~Seeder.html">Seeder</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> <div data-ice="example"> <h4>Example:</h4> <div class="example-doc" data-ice="exampleDoc"> <pre class="prettyprint source-code"><code data-ice="exampleCode">Seeder.extends({ shouldRun: function() { return User.countDocuments() .exec() .then(function(count) { return count === 0; }); }, run: function() { return User.create(data); } });</code></pre> </div> </div> </div> </div> <div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-constructor-constructor"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span class="code" data-ice="name">constructor</span><span class="code" data-ice="signature">()</span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber49">source</a></span></span> </span> </h3> <div data-ice="description"><p>Abstract class can not be constructed. Seeder class should be extended.</p> </div> <div data-ice="properties"> </div> <div data-ice="throwWrap"> <h4>Throw:</h4> <table> <tbody> <tr class="throw" data-ice="throw"> <td><p data-ice="throwName"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError">TypeError</a></span></p></td> <td data-ice="throwDesc"><p>when creating an instance of the abstract class.</p> </td> </tr> <tr class="throw" data-ice="throw"> <td><p data-ice="throwName"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError">TypeError</a></span></p></td> <td data-ice="throwDesc"><p>when the run method is not implemented.</p> </td> </tr> </tbody> </table> </div> </div> </div> <div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-beforeRun"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="async">async</span> <span class="code" data-ice="name">beforeRun</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber88">source</a></span></span> </span> </h3> <div data-ice="description"><p>To perform before run.</p> </div> <div data-ice="properties"> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-getStats"> <span class="access" data-ice="access">public</span> <span class="code" data-ice="name">getStats</span><span class="code" data-ice="signature">(results: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber107">source</a></span></span> </span> </h3> <div data-ice="description"><p>Get stats from seed results.</p> </div> <div data-ice="properties"><div data-ice="properties"> <h4 data-ice="title">Params:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">results</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></span></td> <td data-ice="appendix"><ul><li>optional</li></ul></td> <td data-ice="description"><p>Seed results.</p> </td> </tr> </tbody> </table> </div> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td> </tr> </tbody> </table> <div data-ice="returnProperties"><div data-ice="properties"> <h4 data-ice="title">Return Properties:</h4> <table class="params"> <thead> <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr> </thead> <tbody> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">run</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Did the seeder run?</p> </td> </tr> <tr data-ice="property" data-depth="0"> <td data-ice="name" class="code" data-depth="0">created</td> <td data-ice="type" class="code"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></span></td> <td data-ice="appendix"></td> <td data-ice="description"><p>Amount of records created by the seeder.</p> </td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-run"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="async">async</span> <span class="code" data-ice="name">run</span><span class="code" data-ice="signature">()</span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber94">source</a></span></span> </span> </h3> <div data-ice="description"><p>Run the seeder.</p> </div> <div data-ice="properties"> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-seed"> <span class="access" data-ice="access">public</span> <span data-ice="async">async</span> <span class="code" data-ice="name">seed</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber62">source</a></span></span> </span> </h3> <div data-ice="description"><p>Seed the data.</p> </div> <div data-ice="properties"> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span></td> <td class="return-desc" data-ice="returnDescription"><p>Stats about the save.</p> </td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> <div class="detail" data-ice="detail"> <h3 data-ice="anchor" id="instance-method-shouldRun"> <span class="access" data-ice="access">public</span> <span class="abstract" data-ice="abstract">abstract</span> <span data-ice="async">async</span> <span class="code" data-ice="name">shouldRun</span><span class="code" data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</span> <span class="right-info"> <span data-ice="source"><span><a href="file/src/lib/utils/seeder.js.html#lineNumber79">source</a></span></span> </span> </h3> <div data-ice="description"><p>Should run</p> </div> <div data-ice="properties"> </div> <div class="return-params" data-ice="returnParams"> <h4>Return:</h4> <table> <tbody> <tr> <td class="return-type code" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></span>&lt;<span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span>&gt;</td> <td class="return-desc" data-ice="returnDescription"><p>Indication if should run</p> </td> </tr> </tbody> </table> <div data-ice="returnProperties"> </div> </div> </div> </div> </div> <footer class="footer"> Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a> </footer> <script src="script/search_index.js"></script> <script src="script/search.js"></script> <script src="script/pretty-print.js"></script> <script src="script/inherited-summary.js"></script> <script src="script/test-summary.js"></script> <script src="script/inner-link.js"></script> <script src="script/patch-for-local.js"></script> </body> </html>