Skip to content

Instantly share code, notes, and snippets.

View hereisfahad's full-sized avatar
🎯
Focusing

Fahad Jabbar hereisfahad

🎯
Focusing
View GitHub Profile
@hereisfahad
hereisfahad / eslint_prettier_airbnb.md
Created January 20, 2024 18:17 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@hereisfahad
hereisfahad / enum-access.js
Created March 29, 2020 19:37 — forked from bnoguchi/enum-access.js
How to access enumValues in mongoose from a Model or Document
var mongoose = require('./index')
, TempSchema = new mongoose.Schema({
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']}
});
var Temp = mongoose.model('Temp', TempSchema);
console.log(Temp.schema.path('salutation').enumValues);
var temp = new Temp();
console.log(temp.schema.path('salutation').enumValues);

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database