added array filter option
This commit is contained in:
@@ -42,7 +42,7 @@ export async function listOrgs(params: PageQueryParams, tenantId: string) {
|
||||
const filterObj = getFilterObject(params);
|
||||
|
||||
const orgs = await orgModel.aggregate([
|
||||
{ $match: { $and: [{ tenantId: tenantId }, { ...filterObj }] } },
|
||||
{ $match: { $and: [{ tenantId: tenantId }, ...filterObj] } },
|
||||
{
|
||||
$facet: {
|
||||
metadata: [{ $count: "count" }],
|
||||
@@ -130,7 +130,7 @@ export async function searchOrgs(params: PageQueryParams, tenantId: string) {
|
||||
const regex = new RegExp(params.searchToken, "i");
|
||||
|
||||
const orgs = await orgModel.aggregate([
|
||||
{ $match: { $and: [{ tenantId: tenantId }, { ...filterObj }] } },
|
||||
{ $match: { $and: [{ tenantId: tenantId }, ...filterObj] } },
|
||||
{
|
||||
$match: {
|
||||
$or: [{ name: { $regex: regex } }, { domain: { $regex: regex } }],
|
||||
|
||||
Reference in New Issue
Block a user