UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

1,330 lines 31.1 kB
{ "type": "File", "start": 0, "end": 147, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 11, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 147, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 11, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 39, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 }, "identifierName": "usageGuide" }, "name": "usageGuide" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 38, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 38 } }, "extra": { "rawValue": "./usage-guide", "raw": "'./usage-guide'" }, "value": "./usage-guide" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Prints the help\n ", "start": 41, "end": 67, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } } ] }, { "type": "Identifier", "start": 68, "end": 124, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 8, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 74, "end": 123, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 8, "column": 1 } }, "id": { "type": "Identifier", "start": 74, "end": 78, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 10 }, "identifierName": "help" }, "name": "help", "leadingComments": null }, "init": { "type": "ArrowFunctionExpression", "start": 81, "end": 123, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 8, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [], "body": { "type": "BlockStatement", "start": 93, "end": 123, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 8, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 97, "end": 121, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 26 } }, "expression": { "type": "CallExpression", "start": 97, "end": 120, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 25 } }, "callee": { "type": "MemberExpression", "start": 97, "end": 108, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 13 } }, "object": { "type": "Identifier", "start": 97, "end": 104, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 9 }, "identifierName": "console" }, "name": "console" }, "property": { "type": "Identifier", "start": 105, "end": 108, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 13 }, "identifierName": "log" }, "name": "log" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 109, "end": 119, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 }, "identifierName": "usageGuide" }, "name": "usageGuide" } ] } } ], "directives": [] } }, "leadingComments": null } ], "kind": "const", "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 126, "end": 146, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 20 } }, "declaration": { "type": "Identifier", "start": 141, "end": 145, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 19 }, "identifierName": "help" }, "name": "help" }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 126, "end": 146, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 20 } }, "declaration": { "type": "VariableDeclaration", "start": 68, "end": 124, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 8, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 74, "end": 123, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 8, "column": 1 } }, "id": { "type": "Identifier", "start": 74, "end": 78, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 10 }, "identifierName": "help" }, "name": "help", "leadingComments": null }, "init": { "type": "ArrowFunctionExpression", "start": 81, "end": 123, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 8, "column": 1 } }, "id": { "type": "Identifier", "start": 74, "end": 78, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 10 }, "identifierName": "help" }, "name": "help", "leadingComments": null }, "generator": false, "expression": false, "async": true, "params": [], "body": { "type": "BlockStatement", "start": 93, "end": 123, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 8, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 97, "end": 121, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 26 } }, "expression": { "type": "CallExpression", "start": 97, "end": 120, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 25 } }, "callee": { "type": "MemberExpression", "start": 97, "end": 108, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 13 } }, "object": { "type": "Identifier", "start": 97, "end": 104, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 9 }, "identifierName": "console" }, "name": "console" }, "property": { "type": "Identifier", "start": 105, "end": 108, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 13 }, "identifierName": "log" }, "name": "log" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 109, "end": 119, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 }, "identifierName": "usageGuide" }, "name": "usageGuide" } ] } } ], "directives": [] } }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Prints the help\n ", "start": 41, "end": 67, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } } ], "trailingComments": [] } } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * Prints the help\n ", "start": 41, "end": 67, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "usageGuide", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 18, "end": 22, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 22 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "./usage-guide", "start": 23, "end": 38, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 38 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 38, "end": 39, "loc": { "start": { "line": 1, "column": 38 }, "end": { "line": 1, "column": 39 } } }, { "type": "CommentBlock", "value": "*\n * Prints the help\n ", "start": 41, "end": 67, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 5, "column": 3 } } }, { "type": { "label": "const", "keyword": "const", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "const", "start": 68, "end": 73, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 5 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "help", "start": 74, "end": 78, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 10 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 79, "end": 80, "loc": { "start": { "line": 6, "column": 11 }, "end": { "line": 6, "column": 12 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "async", "start": 81, "end": 86, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 18 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 87, "end": 88, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 6, "column": 20 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 88, "end": 89, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 21 } } }, { "type": { "label": "=>", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 90, "end": 92, "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 6, "column": 24 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 93, "end": 94, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 26 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "console", "start": 97, "end": 104, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 9 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 104, "end": 105, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 10 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "log", "start": 105, "end": 108, "loc": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 13 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 108, "end": 109, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 14 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "usageGuide", "start": 109, "end": 119, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 119, "end": 120, "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 25 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 120, "end": 121, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 26 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 122, "end": 123, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 1 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 123, "end": 124, "loc": { "start": { "line": 8, "column": 1 }, "end": { "line": 8, "column": 2 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 126, "end": 132, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 6 } } }, { "type": { "label": "default", "keyword": "default", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "default", "start": 133, "end": 140, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 14 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "help", "start": 141, "end": 145, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 19 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 145, "end": 146, "loc": { "start": { "line": 10, "column": 19 }, "end": { "line": 10, "column": 20 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 147, "end": 147, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 0 } } } ] }