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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Debug Nest Framework", | |
"args": [ | |
"${workspaceFolder}/src/main.ts" | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum EBreeds { | |
AKITA, | |
SCOTTISH_TERRIER | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Os dois exemplos a seguir funcionam perfeitamente. | |
*/ | |
enum EBreeds { | |
AKITA = 'AKITA', | |
SCOTTISH_TERRIER = 'SCOTTISH_TERRIER' | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) {} |