npm i lodash
const lodash=require('lodash');
var project = [{'name':'p1','manager':'r1'},{'name':'p2','manager':'r2'},{'name':'p3','manager':'r1'} ,{'name':'p4','manager':'r2'} ];
var r2groupby = lodash.filter(project , { 'manager': 'r2' } );
console.log(r2groupby);