UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

1,464 lines (1,463 loc) 98.4 kB
{ "type": "File", "start": 0, "end": 480, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 28, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 480, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 28, "column": 0 } }, "sourceType": "module", "body": [ { "type": "Identifier", "start": 63, "end": 444, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 25, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 69, "end": 443, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 25, "column": 1 } }, "id": { "type": "Identifier", "start": 69, "end": 86, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 23 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions", "leadingComments": null }, "init": { "type": "ArrayExpression", "start": 89, "end": 443, "loc": { "start": { "line": 5, "column": 26 }, "end": { "line": 25, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 93, "end": 199, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 11, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 99, "end": 120, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 25 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 99, "end": 103, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 8 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "StringLiteral", "start": 105, "end": 120, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 25 } }, "extra": { "rawValue": "seedersFolder", "raw": "'seedersFolder'" }, "value": "seedersFolder" } }, { "type": "ObjectProperty", "start": 126, "end": 136, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 14 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 126, "end": 131, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 9 }, "identifierName": "alias" }, "name": "alias" }, "value": { "type": "StringLiteral", "start": 133, "end": 136, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 14 } }, "extra": { "rawValue": "f", "raw": "'f'" }, "value": "f" } }, { "type": "ObjectProperty", "start": 142, "end": 154, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 142, "end": 146, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 8 }, "identifierName": "type" }, "name": "type" }, "value": { "type": "Identifier", "start": 148, "end": 154, "loc": { "start": { "line": 9, "column": 10 }, "end": { "line": 9, "column": 16 }, "identifierName": "String" }, "name": "String" } }, { "type": "ObjectProperty", "start": 160, "end": 194, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 38 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 160, "end": 171, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 15 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 173, "end": 194, "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 38 } }, "extra": { "rawValue": "Seeders folder name", "raw": "'Seeders folder name'" }, "value": "Seeders folder name" } } ] }, { "type": "ObjectExpression", "start": 203, "end": 316, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 17, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 209, "end": 231, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 209, "end": 213, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 8 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "StringLiteral", "start": 215, "end": 231, "loc": { "start": { "line": 13, "column": 10 }, "end": { "line": 13, "column": 26 } }, "extra": { "rawValue": "seederTemplate", "raw": "'seederTemplate'" }, "value": "seederTemplate" } }, { "type": "ObjectProperty", "start": 237, "end": 247, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 14 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 237, "end": 242, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 9 }, "identifierName": "alias" }, "name": "alias" }, "value": { "type": "StringLiteral", "start": 244, "end": 247, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 14 } }, "extra": { "rawValue": "t", "raw": "'t'" }, "value": "t" } }, { "type": "ObjectProperty", "start": 253, "end": 265, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 253, "end": 257, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 8 }, "identifierName": "type" }, "name": "type" }, "value": { "type": "Identifier", "start": 259, "end": 265, "loc": { "start": { "line": 15, "column": 10 }, "end": { "line": 15, "column": 16 }, "identifierName": "String" }, "name": "String" } }, { "type": "ObjectProperty", "start": 271, "end": 311, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 44 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 271, "end": 282, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 15 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 284, "end": 311, "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 44 } }, "extra": { "rawValue": "Seeder template file path", "raw": "'Seeder template file path'" }, "value": "Seeder template file path" } } ] }, { "type": "ObjectExpression", "start": 320, "end": 440, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 24, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 326, "end": 338, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 326, "end": 330, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 8 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "StringLiteral", "start": 332, "end": 338, "loc": { "start": { "line": 19, "column": 10 }, "end": { "line": 19, "column": 16 } }, "extra": { "rawValue": "help", "raw": "'help'" }, "value": "help" } }, { "type": "ObjectProperty", "start": 344, "end": 354, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 14 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 344, "end": 349, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 9 }, "identifierName": "alias" }, "name": "alias" }, "value": { "type": "StringLiteral", "start": 351, "end": 354, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 14 } }, "extra": { "rawValue": "h", "raw": "'h'" }, "value": "h" } }, { "type": "ObjectProperty", "start": 360, "end": 373, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 17 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 360, "end": 364, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 8 }, "identifierName": "type" }, "name": "type" }, "value": { "type": "Identifier", "start": 366, "end": 373, "loc": { "start": { "line": 21, "column": 10 }, "end": { "line": 21, "column": 17 }, "identifierName": "Boolean" }, "name": "Boolean" } }, { "type": "ObjectProperty", "start": 379, "end": 398, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 379, "end": 391, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 16 }, "identifierName": "defaultValue" }, "name": "defaultValue" }, "value": { "type": "BooleanLiteral", "start": 393, "end": 398, "loc": { "start": { "line": 22, "column": 18 }, "end": { "line": 22, "column": 23 } }, "value": false } }, { "type": "ObjectProperty", "start": 404, "end": 435, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 35 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 404, "end": 415, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 15 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 417, "end": 435, "loc": { "start": { "line": 23, "column": 17 }, "end": { "line": 23, "column": 35 } }, "extra": { "rawValue": "Show usage guide", "raw": "'Show usage guide'" }, "value": "Show usage guide" } } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 446, "end": 479, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 27, "column": 33 } }, "declaration": { "type": "Identifier", "start": 461, "end": 478, "loc": { "start": { "line": 27, "column": 15 }, "end": { "line": 27, "column": 32 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions" }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 446, "end": 479, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 27, "column": 33 } }, "declaration": { "type": "VariableDeclaration", "start": 63, "end": 444, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 25, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 69, "end": 443, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 25, "column": 1 } }, "id": { "type": "Identifier", "start": 69, "end": 86, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 23 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions", "leadingComments": null }, "init": { "type": "ArrayExpression", "start": 89, "end": 443, "loc": { "start": { "line": 5, "column": 26 }, "end": { "line": 25, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 93, "end": 199, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 11, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 99, "end": 120, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 25 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 99, "end": 103, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 8 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "StringLiteral", "start": 105, "end": 120, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 25 } }, "extra": { "rawValue": "seedersFolder", "raw": "'seedersFolder'" }, "value": "seedersFolder" } }, { "type": "ObjectProperty", "start": 126, "end": 136, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 14 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 126, "end": 131, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 9 }, "identifierName": "alias" }, "name": "alias" }, "value": { "type": "StringLiteral", "start": 133, "end": 136, "loc": { "start": { "line": 8, "column": 11 }, "end": { "line": 8, "column": 14 } }, "extra": { "rawValue": "f", "raw": "'f'" }, "value": "f" } }, { "type": "ObjectProperty", "start": 142, "end": 154, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 142, "end": 146, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 8 }, "identifierName": "type" }, "name": "type" }, "value": { "type": "Identifier", "start": 148, "end": 154, "loc": { "start": { "line": 9, "column": 10 }, "end": { "line": 9, "column": 16 }, "identifierName": "String" }, "name": "String" } }, { "type": "ObjectProperty", "start": 160, "end": 194, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 38 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 160, "end": 171, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 15 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 173, "end": 194, "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 38 } }, "extra": { "rawValue": "Seeders folder name", "raw": "'Seeders folder name'" }, "value": "Seeders folder name" } } ] }, { "type": "ObjectExpression", "start": 203, "end": 316, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 17, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 209, "end": 231, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 209, "end": 213, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 8 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "StringLiteral", "start": 215, "end": 231, "loc": { "start": { "line": 13, "column": 10 }, "end": { "line": 13, "column": 26 } }, "extra": { "rawValue": "seederTemplate", "raw": "'seederTemplate'" }, "value": "seederTemplate" } }, { "type": "ObjectProperty", "start": 237, "end": 247, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 14 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 237, "end": 242, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 9 }, "identifierName": "alias" }, "name": "alias" }, "value": { "type": "StringLiteral", "start": 244, "end": 247, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 14 } }, "extra": { "rawValue": "t", "raw": "'t'" }, "value": "t" } }, { "type": "ObjectProperty", "start": 253, "end": 265, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 253, "end": 257, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 8 }, "identifierName": "type" }, "name": "type" }, "value": { "type": "Identifier", "start": 259, "end": 265, "loc": { "start": { "line": 15, "column": 10 }, "end": { "line": 15, "column": 16 }, "identifierName": "String" }, "name": "String" } }, { "type": "ObjectProperty", "start": 271, "end": 311, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 44 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 271, "end": 282, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 15 }, "identifierName": "description" }, "name": "description" }, "value": { "type": "StringLiteral", "start": 284, "end": 311, "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 44 } }, "extra": { "rawValue": "Seeder template file path", "raw": "'Seeder template file path'" }, "value": "Seeder template file path" } } ] }, { "type": "ObjectExpression", "start": 320, "end": 440, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 24, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 326, "end": 338, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 16 } },