mongoose-data-seed
Version:
Seed mongodb with data using mongoose models
1,368 lines (1,367 loc) • 100 kB
JSON
{
"type": "File",
"start": 0,
"end": 1291,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 50,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1291,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 50,
"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"
}
},
{
"type": "ImportDeclaration",
"start": 53,
"end": 106,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 53
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 60,
"end": 77,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 24
}
},
"local": {
"type": "Identifier",
"start": 60,
"end": 77,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 24
},
"identifierName": "optionDefinitions"
},
"name": "optionDefinitions"
}
}
],
"source": {
"type": "StringLiteral",
"start": 83,
"end": 105,
"loc": {
"start": {
"line": 2,
"column": 30
},
"end": {
"line": 2,
"column": 52
}
},
"extra": {
"rawValue": "./option-definitions",
"raw": "'./option-definitions'"
},
"value": "./option-definitions"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Run command user guide\n * @type {string}\n ",
"start": 108,
"end": 159,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 7,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"start": 160,
"end": 1262,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 47,
"column": 3
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 166,
"end": 1261,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 47,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 166,
"end": 176,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 16
},
"identifierName": "usageGuide"
},
"name": "usageGuide",
"leadingComments": null
},
"init": {
"type": "CallExpression",
"start": 179,
"end": 1261,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 47,
"column": 2
}
},
"callee": {
"type": "Identifier",
"start": 179,
"end": 197,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 37
},
"identifierName": "generateUsageGuide"
},
"name": "generateUsageGuide"
},
"arguments": [
{
"type": "ArrayExpression",
"start": 198,
"end": 1260,
"loc": {
"start": {
"line": 8,
"column": 38
},
"end": {
"line": 47,
"column": 1
}
},
"elements": [
{
"type": "ObjectExpression",
"start": 202,
"end": 278,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 12,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 208,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 208,
"end": 214,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 216,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 25
}
},
"extra": {
"rawValue": "Seed runner",
"raw": "'Seed runner'"
},
"value": "Seed runner"
}
},
{
"type": "ObjectProperty",
"start": 235,
"end": 273,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 42
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 235,
"end": 242,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 11
},
"identifierName": "content"
},
"name": "content"
},
"value": {
"type": "StringLiteral",
"start": 244,
"end": 273,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 42
}
},
"extra": {
"rawValue": "Seed data into the database",
"raw": "'Seed data into the database'"
},
"value": "Seed data into the database"
}
}
]
},
{
"type": "ObjectExpression",
"start": 282,
"end": 453,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 19,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 288,
"end": 306,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 22
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 288,
"end": 294,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 296,
"end": 306,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 22
}
},
"extra": {
"rawValue": "Synopsis",
"raw": "'Synopsis'"
},
"value": "Synopsis"
}
},
{
"type": "ObjectProperty",
"start": 312,
"end": 448,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 312,
"end": 319,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 11
},
"identifierName": "content"
},
"name": "content"
},
"value": {
"type": "ArrayExpression",
"start": 321,
"end": 448,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 18,
"column": 5
}
},
"elements": [
{
"type": "StringLiteral",
"start": 329,
"end": 404,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 81
}
},
"extra": {
"rawValue": "$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]",
"raw": "'$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]'"
},
"value": "$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]"
},
{
"type": "StringLiteral",
"start": 412,
"end": 441,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 35
}
},
"extra": {
"rawValue": "$ md-seed run {bold --help}",
"raw": "'$ md-seed run {bold --help}'"
},
"value": "$ md-seed run {bold --help}"
}
]
}
}
]
},
{
"type": "ObjectExpression",
"start": 457,
"end": 520,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 23,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 463,
"end": 480,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 21
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 463,
"end": 469,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 471,
"end": 480,
"loc": {
"start": {
"line": 21,
"column": 12
},
"end": {
"line": 21,
"column": 21
}
},
"extra": {
"rawValue": "Options",
"raw": "'Options'"
},
"value": "Options"
}
},
{
"type": "ObjectProperty",
"start": 486,
"end": 515,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 33
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 486,
"end": 496,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 14
},
"identifierName": "optionList"
},
"name": "optionList"
},
"value": {
"type": "Identifier",
"start": 498,
"end": 515,
"loc": {
"start": {
"line": 22,
"column": 16
},
"end": {
"line": 22,
"column": 33
},
"identifierName": "optionDefinitions"
},
"name": "optionDefinitions"
}
}
]
},
{
"type": "ObjectExpression",
"start": 524,
"end": 1257,
"loc": {
"start": {
"line": 24,
"column": 2
},
"end": {
"line": 46,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 530,
"end": 548,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 22
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 530,
"end": 536,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 538,
"end": 548,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 22
}
},
"extra": {
"rawValue": "Examples",
"raw": "'Examples'"
},
"value": "Examples"
}
},
{
"type": "ObjectProperty",
"start": 554,
"end": 1252,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 45,
"column": 7
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 554,
"end": 561,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 26,
"column": 11
},
"identifierName": "content"
},
"name": "content"
},
"value": {
"type": "TemplateLiteral",
"start": 563,
"end": 1252,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 45,
"column": 7
}
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"start": 564,
"end": 1251,
"loc": {
"start": {
"line": 26,
"column": 14
},
"end": {
"line": 45,
"column": 6
}
},
"value": {
"raw": "{bold 1. Run all seeders:}\n $ md-seed run\n\n {bold 2. Run selected seeders:}\n $ md-seed run {bold --seeders} {underline User} {underline Settings}\n {italic or}\n $ md-seed run {bold -s} {underline User} {underline Settings}\n {italic or}\n $ md-seed run {underline User} {underline Settings}\n\n {bold 3. Drop database and run all seeders:}\n $ md-seed run {bold --dropdb}\n {italic or}\n $ md-seed run {bold -d}\n\n {bold 4. Drop database and run selected seeders:}\n $ md-seed run {underline User} {underline Settings} {bold --dropdb}\n {italic or}\n $ md-seed run {underline User} {underline Settings} {bold -d}\n ",
"cooked": "{bold 1. Run all seeders:}\n $ md-seed run\n\n {bold 2. Run selected seeders:}\n $ md-seed run {bold --seeders} {underline User} {underline Settings}\n {italic or}\n $ md-seed run {bold -s} {underline User} {underline Settings}\n {italic or}\n $ md-seed run {underline User} {underline Settings}\n\n {bold 3. Drop database and run all seeders:}\n $ md-seed run {bold --dropdb}\n {italic or}\n $ md-seed run {bold -d}\n\n {bold 4. Drop database and run selected seeders:}\n $ md-seed run {underline User} {underline Settings} {bold --dropdb}\n {italic or}\n $ md-seed run {underline User} {underline Settings} {bold -d}\n "
},
"tail": true
}
]
}
}
]
}
]
}
]
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [],
"name": "_",
"trailingComments": []
},
{
"type": "Identifier",
"start": 1264,
"end": 1290,
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 49,
"column": 26
}
},
"declaration": {
"type": "Identifier",
"start": 1279,
"end": 1289,
"loc": {
"start": {
"line": 49,
"column": 15
},
"end": {
"line": 49,
"column": 25
},
"identifierName": "usageGuide"
},
"name": "usageGuide"
},
"name": "_",
"leadingComments": [],
"trailingComments": []
},
{
"type": "ExportDefaultDeclaration",
"start": 1264,
"end": 1290,
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 49,
"column": 26
}
},
"declaration": {
"type": "VariableDeclaration",
"start": 160,
"end": 1262,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 47,
"column": 3
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 166,
"end": 1261,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 47,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 166,
"end": 176,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 16
},
"identifierName": "usageGuide"
},
"name": "usageGuide",
"leadingComments": null
},
"init": {
"type": "CallExpression",
"start": 179,
"end": 1261,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 47,
"column": 2
}
},
"callee": {
"type": "Identifier",
"start": 179,
"end": 197,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 37
},
"identifierName": "generateUsageGuide"
},
"name": "generateUsageGuide"
},
"arguments": [
{
"type": "ArrayExpression",
"start": 198,
"end": 1260,
"loc": {
"start": {
"line": 8,
"column": 38
},
"end": {
"line": 47,
"column": 1
}
},
"elements": [
{
"type": "ObjectExpression",
"start": 202,
"end": 278,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 12,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 208,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 208,
"end": 214,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 216,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 25
}
},
"extra": {
"rawValue": "Seed runner",
"raw": "'Seed runner'"
},
"value": "Seed runner"
}
},
{
"type": "ObjectProperty",
"start": 235,
"end": 273,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 42
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 235,
"end": 242,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 11
},
"identifierName": "content"
},
"name": "content"
},
"value": {
"type": "StringLiteral",
"start": 244,
"end": 273,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 42
}
},
"extra": {
"rawValue": "Seed data into the database",
"raw": "'Seed data into the database'"
},
"value": "Seed data into the database"
}
}
]
},
{
"type": "ObjectExpression",
"start": 282,
"end": 453,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 19,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 288,
"end": 306,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 22
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 288,
"end": 294,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 296,
"end": 306,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 22
}
},
"extra": {
"rawValue": "Synopsis",
"raw": "'Synopsis'"
},
"value": "Synopsis"
}
},
{
"type": "ObjectProperty",
"start": 312,
"end": 448,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 312,
"end": 319,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 11
},
"identifierName": "content"
},
"name": "content"
},
"value": {
"type": "ArrayExpression",
"start": 321,
"end": 448,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 18,
"column": 5
}
},
"elements": [
{
"type": "StringLiteral",
"start": 329,
"end": 404,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 81
}
},
"extra": {
"rawValue": "$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]",
"raw": "'$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]'"
},
"value": "$ md-seed run [{bold --dropdb}] [{bold --seeders} {underline seeder} ...]"
},
{
"type": "StringLiteral",
"start": 412,
"end": 441,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 35
}
},
"extra": {
"rawValue": "$ md-seed run {bold --help}",
"raw": "'$ md-seed run {bold --help}'"
},
"value": "$ md-seed run {bold --help}"
}
]
}
}
]
},
{
"type": "ObjectExpression",
"start": 457,
"end": 520,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 23,
"column": 3
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 463,
"end": 480,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 21
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 463,
"end": 469,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 10
},
"identifierName": "header"
},
"name": "header"
},
"value": {
"type": "StringLiteral",
"start": 471,
"end": 480,
"loc": {
"start": {
"line": 21,
"column": 12
},
"end": {
"line": 21,
"column": 21
}
},
"extra": {
"rawValue": "Options",
"raw": "'Options'"
},
"value": "Options"
}
},
{
"type": "ObjectProperty",
"start": 486,
"end": 515,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,