Skip to content

Commit 8d7d785

Browse files
committed
use Mongo.Collection.get to get collection instance by name
1 parent c733ab7 commit 8d7d785

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/client/fileUpload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor';
33
import { AutoForm } from 'meteor/aldeed:autoform';
44
import { Template } from 'meteor/templating';
55
import { ReactiveVar } from 'meteor/reactive-var';
6+
import { Mongo } from 'meteor/mongo';
67

78
Template.afFileUpload.onCreated(function () {
89
if (!this.data) {
@@ -11,7 +12,7 @@ Template.afFileUpload.onCreated(function () {
1112
};
1213
}
1314

14-
this.collection = Meteor.connection._mongo_livedata_collections[this.data.atts.collection];
15+
this.collection = Mongo.Collection.get(his.data.atts.collection); //Meteor.connection._mongo_livedata_collections[this.data.atts.collection];
1516
this.uploadTemplate = this.data.atts.uploadTemplate || null;
1617
this.previewTemplate = this.data.atts.previewTemplate || null;
1718

package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package.describe({
22
name: 'ostrio:autoform-files',
33
summary: 'File upload for AutoForm using ostrio:files',
44
description: 'File upload for AutoForm using ostrio:files',
5-
version: '2.0.1',
5+
version: '2.0.2',
66
git: 'https://github.com/VeliovGroup/meteor-autoform-file.git'
77
});
88

@@ -13,6 +13,7 @@ Package.onUse(function(api) {
1313
'check',
1414
'ecmascript',
1515
'underscore',
16+
'mongo',
1617
'reactive-var',
1718
'templating',
1819
'aldeed:autoform@6.2.0',

0 commit comments

Comments
 (0)