mongorestore --uri='mongodb://root:example@localhost:27017/db_name?authSource=admin' -d db_name ./database
mongorestore --uri='mongodb://root:example@localhost:27017/db_name?authSource=admin' --gzip ./database
| class EBreeds { | |
| private static map = new Map<string, EBreeds>(); | |
| public static readonly AKITA = EBreeds.build('AKITA', 'Cão grande branco e peludo'); | |
| public static readonly SCOTTISH_TERRIER = EBreeds.build('SCOTTISH_TERRIER', 'Cão pequeno'); | |
| private constructor( | |
| public readonly code: string, | |
| public readonly desc: string | |
| ) {} |
| export class EBreeds { | |
| public code:string; | |
| public desc: string; | |
| public static readonly AKITA = new EBreeds('AKITA', 'Cão grande branco e peludo'); | |
| public static readonly SCOTTISH_TERRIER = new EBreeds('SCOTTISH_TERRIER', 'Cão pequeno'); | |
| private constructor(code: string, desc: string) { | |
| this.code = code; | |
| this.desc = desc; |
| /** | |
| * Os dois exemplos a seguir funcionam perfeitamente. | |
| */ | |
| enum EBreeds { | |
| AKITA = 'AKITA', | |
| SCOTTISH_TERRIER = 'SCOTTISH_TERRIER' | |
| } | |
| /** | |
| * Como podem ver a seguir um objeto simples javascript pode funcionar como um simples enum. Temos as chaves e temos os valores | |
| */ | |
| const EBreeds = { | |
| AKITA: 'AKITA', | |
| SCOTTISH_TERRIER: 'SCOTTISH_TERRIER' | |
| } | |
| /** | |
| * A situação a seguir contempla uma situação em que temos o enum e uma descrição daquela chave. |
| enum EBreeds { | |
| AKITA, | |
| SCOTTISH_TERRIER | |
| } |
| import { Parser } from "xml2js"; | |
| const parseName = (name: string) => (name.indexOf(':') !== -1 ? name.split(':')[1] : name); | |
| const camelize = (name: string) => name[0].toLowerCase() + name.substring(1, name.length); | |
| const envelope = import { Parser } from "xml2js"; | |
| await new Parser({ | |
| explicitArray: false, | |
| explicitRoot : false, | |
| trim: true, | |
| emptyTag: true, |
| import { addMinutes, addHours, addDays } from "date-fns"; | |
| export enum EFrequency { | |
| EVERY_10_MINUTES = 'EVERY_10_MINUTES', | |
| EVERY_HOUR = 'EVERY_HOUR', | |
| EVERY_DAY = 'EVERY_DAY' | |
| } | |
| export class Frequency { | |
| public frequencyType: EFrequency; |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Debug Nest Framework", | |
| "args": [ | |
| "${workspaceFolder}/src/main.ts" | |
| ], |
mongorestore --uri='mongodb://root:example@localhost:27017/db_name?authSource=admin' -d db_name ./database
mongorestore --uri='mongodb://root:example@localhost:27017/db_name?authSource=admin' --gzip ./database