Creates and pushes a new entry into the collection.
Last updated 2 years 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.get(); // [{ id: 1, name: 'Peter', salary: 1200 }, { id: 2, name: 'Michael', salary: 900 }]
Parameter
Description
data
Data
Entry's data
Returns
The newly created entry