UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

1,281 lines (1,280 loc) 145 kB
{ "type": "File", "start": 0, "end": 799, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 40, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 799, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 40, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 52, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 52 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 25, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 25 } }, "local": { "type": "Identifier", "start": 7, "end": 25, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 25 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" } } ], "source": { "type": "StringLiteral", "start": 31, "end": 51, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 51 } }, "extra": { "rawValue": "command-line-usage", "raw": "'command-line-usage'" }, "value": "command-line-usage" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Help command user guide\n * @type {string}\n ", "start": 54, "end": 106, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 6, "column": 3 } } } ] }, { "type": "Identifier", "start": 107, "end": 770, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 37, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 113, "end": 769, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 37, "column": 2 } }, "id": { "type": "Identifier", "start": 113, "end": 123, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 16 }, "identifierName": "usageGuide" }, "name": "usageGuide", "leadingComments": null }, "init": { "type": "CallExpression", "start": 126, "end": 769, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 37, "column": 2 } }, "callee": { "type": "Identifier", "start": 126, "end": 144, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 7, "column": 37 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" }, "arguments": [ { "type": "ArrayExpression", "start": 145, "end": 768, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 37, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 149, "end": 234, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 11, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 155, "end": 185, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 34 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 155, "end": 161, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 163, "end": 185, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 34 } }, "extra": { "rawValue": "Mongoose Data Seeder", "raw": "'Mongoose Data Seeder'" }, "value": "Mongoose Data Seeder" } }, { "type": "ObjectProperty", "start": 191, "end": 229, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 42 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 191, "end": 198, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "StringLiteral", "start": 200, "end": 229, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 42 } }, "extra": { "rawValue": "Seed data into the database", "raw": "'Seed data into the database'" }, "value": "Seed data into the database" } } ] }, { "type": "ObjectExpression", "start": 238, "end": 315, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 15, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 244, "end": 262, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 244, "end": 250, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 252, "end": 262, "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 22 } }, "extra": { "rawValue": "Synopsis", "raw": "'Synopsis'" }, "value": "Synopsis" } }, { "type": "ObjectProperty", "start": 268, "end": 310, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 46 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 268, "end": 275, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "ArrayExpression", "start": 277, "end": 310, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 46 } }, "elements": [ { "type": "StringLiteral", "start": 278, "end": 309, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 45 } }, "extra": { "rawValue": "$ md-seed <command> <options>", "raw": "'$ md-seed <command> <options>'" }, "value": "$ md-seed <command> <options>" } ] } } ] }, { "type": "ObjectExpression", "start": 319, "end": 765, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 36, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 325, "end": 347, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 325, "end": 331, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 333, "end": 347, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 26 } }, "extra": { "rawValue": "Command List", "raw": "'Command List'" }, "value": "Command List" } }, { "type": "ObjectProperty", "start": 353, "end": 760, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 35, "column": 5 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 353, "end": 360, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "ArrayExpression", "start": 362, "end": 760, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 35, "column": 5 } }, "elements": [ { "type": "ObjectExpression", "start": 370, "end": 474, "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 22, "column": 7 } }, "properties": [ { "type": "ObjectProperty", "start": 380, "end": 395, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 380, "end": 387, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 15 }, "identifierName": "command" }, "name": "command" }, "value": { "type": "StringLiteral", "start": 389, "end": 395, "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 23 } }, "extra": { "rawValue": "init", "raw": "'init'" }, "value": "init" } }, { "type": "ObjectProperty", "start": 405, "end": 465, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 68 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 405, "end": 416, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 19 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 418, "end": 465, "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 21, "column": 68 } }, "extra": { "rawValue": "Install mongoose-data-seed into your project.", "raw": "'Install mongoose-data-seed into your project.'" }, "value": "Install mongoose-data-seed into your project." } } ] }, { "type": "ObjectExpression", "start": 482, "end": 596, "loc": { "start": { "line": 23, "column": 6 }, "end": { "line": 26, "column": 7 } }, "properties": [ { "type": "ObjectProperty", "start": 492, "end": 514, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 30 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 492, "end": 499, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 15 }, "identifierName": "command" }, "name": "command" }, "value": { "type": "StringLiteral", "start": 501, "end": 514, "loc": { "start": { "line": 24, "column": 17 }, "end": { "line": 24, "column": 30 } }, "extra": { "rawValue": "g, generate", "raw": "'g, generate'" }, "value": "g, generate" } }, { "type": "ObjectProperty", "start": 524, "end": 587, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 71 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 524, "end": 535, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 19 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 537, "end": 587, "loc": { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 71 } }, "extra": { "rawValue": "Generate new seeder file into the seeder folder.", "raw": "'Generate new seeder file into the seeder folder.'" }, "value": "Generate new seeder file into the seeder folder." } } ] }, { "type": "ObjectExpression", "start": 604, "end": 674, "loc": { "start": { "line": 27, "column": 6 }, "end": { "line": 30, "column": 7 } }, "properties": [ { "type": "ObjectProperty", "start": 614, "end": 628, "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 614, "end": 621, "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 15 }, "identifierName": "command" }, "name": "command" }, "value": { "type": "StringLiteral", "start": 623, "end": 628, "loc": { "start": { "line": 28, "column": 17 }, "end": { "line": 28, "column": 22 } }, "extra": { "rawValue": "run", "raw": "'run'" }, "value": "run" } }, { "type": "ObjectProperty", "start": 638, "end": 665, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 35 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 638, "end": 649, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 19 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 651, "end": 665, "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 35 } }, "extra": { "rawValue": "Run seeders.", "raw": "'Run seeders.'" }, "value": "Run seeders." } } ] }, { "type": "ObjectExpression", "start": 682, "end": 753, "loc": { "start": { "line": 31, "column": 6 }, "end": { "line": 34, "column": 7 } }, "properties": [ { "type": "ObjectProperty", "start": 692, "end": 710, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 692, "end": 699, "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 15 }, "identifierName": "command" }, "name": "command" }, "value": { "type": "StringLiteral", "start": 701, "end": 710, "loc": { "start": { "line": 32, "column": 17 }, "end": { "line": 32, "column": 26 } }, "extra": { "rawValue": "h, help", "raw": "'h, help'" }, "value": "h, help" } }, { "type": "ObjectProperty", "start": 720, "end": 744, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 32 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 720, "end": 731, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 19 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 733, "end": 744, "loc": { "start": { "line": 33, "column": 21 }, "end": { "line": 33, "column": 32 } }, "extra": { "rawValue": "Show help", "raw": "'Show help'" }, "value": "Show help" } } ] } ] } } ] } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 772, "end": 798, "loc": { "start": { "line": 39, "column": 0 }, "end": { "line": 39, "column": 26 } }, "declaration": { "type": "Identifier", "start": 787, "end": 797, "loc": { "start": { "line": 39, "column": 15 }, "end": { "line": 39, "column": 25 }, "identifierName": "usageGuide" }, "name": "usageGuide" }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 772, "end": 798, "loc": { "start": { "line": 39, "column": 0 }, "end": { "line": 39, "column": 26 } }, "declaration": { "type": "VariableDeclaration", "start": 107, "end": 770, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 37, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 113, "end": 769, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 37, "column": 2 } }, "id": { "type": "Identifier", "start": 113, "end": 123, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 16 }, "identifierName": "usageGuide" }, "name": "usageGuide", "leadingComments": null }, "init": { "type": "CallExpression", "start": 126, "end": 769, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 37, "column": 2 } }, "callee": { "type": "Identifier", "start": 126, "end": 144, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 7, "column": 37 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" }, "arguments": [ { "type": "ArrayExpression", "start": 145, "end": 768, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 37, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 149, "end": 234, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 11,