.remove()

Removes the entries that match the provided filter. Removes all the entries from the collection if no filter is provided.

remove(filter)

// Note: People is a collection.

People.getAll();  // [{ id: 1, name: 'Peter', salary: 1200 }, { id: 2, name: 'Michael', salary: 900 }] 

People.remove(person => person.salary < 1000); // [{ id: 1, name: 'Peter', salary: 1200 }] 

People.getAll();  // [{ id: 1, name: 'Peter', salary: 1200 }] 

Last updated