.save()
Writes the cached data into the collection's JSON file.
save()
// Note: Users is a collection.
Users.get(); // [{ id: 1, name: 'Peter' }]
Users.create({ id: 2, name: 'Michael' }); // { id: 2, name: 'Michael' }
Users.get(); // [{ id: 1, name: 'Peter' }, { id: 2, name: 'Michael' }] (cached only)
Users.fetch(); // [{ id: 1, name: 'Peter' }]
Users.save();
Users.get(); // [{ id: 1, name: 'Peter' }, { id: 2, name: 'Michael' }] (cached and written in the JSON file)
Users.fetch(); // [{ id: 1, name: 'Peter' }, { id: 2, name: 'Michael' }]Last updated