Hi,
Inserting my apps on the client works well. (Object array from REST service)
now, I also want to put my “streams” in another collection (same as above but other business meaning)
The log shows no error, I see the documents also flashing in the screen, but then they are removed and get this strange error
insert failed: Method '/streams/insert' not found
but I just do the same as with the apps insertion (works fine), but now for the streams collection it does not work
My code is
var updateAppsCollection = function(){
// set Session variable in method callback
Meteor.call('getApps', function(error, docList){
 if(error){
  console.error(error);
}
else{
  // console.log('try to insert document array into mongo, first delete all current data in mongo apps table');
  // Delete all existing apps from database
  Apps.find().forEach(function(app) {
    Apps.remove(app._id);
  });
  //insert all docs into the database
  docList.forEach(function(doc) {
   Apps.insert(doc);
 })
}
})
console.log('insert streams in collection');
Meteor.call('getStreams', function(error, docList){
  console.log('insert streams', docList);
  docList.forEach(function(s){
    Streams.insert(s);
  })
});
};
my helpers and imports
import { Template } from 'meteor/templating';
import { Customers } from '../api/customers.js';
import { Session } from 'meteor/session';
// import * from '/lib/globalHelpers.js';
import './body.html';
import {Apps} from '/imports/api/apps.js'
import {Streams} from '/imports/api/streams.js'
import './customer.js';
import moment from 'moment';
import lodash from 'lodash';
_ = lodash;
Template.body.helpers({
  customers() {
    return Customers.find({}, { sort: { createdAt: -1 } });
  },
  apps(){
    //return Session.get('qApps'); 
    return Apps.find();
  },
  streams(){
    return Streams.find();
  },
  countStreams(){
    return Streams.find().count();
  },
  countApps(){
    return Apps.find().count();
  },
  formatDate (date) {
    return moment(date).format('DD-MM-YYYY');
  }
});
