Skip to content

Instantly share code, notes, and snippets.

@tgmarinho
Created April 20, 2018 17:43
Show Gist options
  • Save tgmarinho/b86783db64e708264e6dd6a1cbe0c924 to your computer and use it in GitHub Desktop.
Save tgmarinho/b86783db64e708264e6dd6a1cbe0c924 to your computer and use it in GitHub Desktop.
Add new todos from main.js Meteor
// Add new todos
import { Meteor } from 'meteor/meteor';
import { TasksCollection } from 'my/path/to/collections/TasksCollection';
Meteor.startup(function() {
const data = JSON.parse(Assets.getText('csvjson.json')); // esta na pasta private do Meteor
console.log(data.length);
data.forEach(item => {
TasksCollection.add(item);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment