Creates and pushes a new entry into the collection.
Last updated 10 months ago
// Note: People is a collection. // This collection was created with a default value of 900 for the 'salary' key. People.create({ id: 1, name: 'Peter', salary: 1200 }); // { id: 1, name: 'Peter', salary: 1200 } People.create({ id: 2, name: 'Michael' }); // { id: 2, name: 'Michael', salary: 900 } People.getAll(); // [{ id: 1, name: 'Peter', salary: 1200 }, { id: 2, name: 'Michael', salary: 900 }]
Parameter
Description
data
Data
Entry's data
Returns
The newly created entry