.getMany()

Returns the entries that match the provided filter.

getMany(filter)

Parameter

Description

filter

Callback

Function to test each element of the array. Return a value that coerces to true to keep the element, or to false otherwise

Returns

Description

Entries that match the filter

// Note: Users is a collection.

Users.createBulk([
  { name: 'Peter', age: 20 },
  { name: 'Henry', age: 18 },
  { name: 'John', age: 15 }
]);

Users.getMany(user => user.age > 18); // [{ name: 'Peter', age: 20 }, { name: 'Henry', age: 18 }] 

Last updated