Skip to content

Instantly share code, notes, and snippets.

View patelmohit719's full-sized avatar
🏠
Working from home

Mohit Patel patelmohit719

🏠
Working from home
View GitHub Profile
@patelmohit719
patelmohit719 / filterArray.js
Created January 9, 2022 15:10 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database