Learn Programming through LIVE online classrooms

Meteor Discussion Forums

There's no such thing as a stupid question. Ask. Discuss. Learn.

Name of collection from string variable

I want to write this:

import {MyCollection} from "../../imports/collections/mycollection";

collection = 'MyCollection';

collection.find(); //dont work

i want result simillar as:

MyCollection.find();

Something like in php $$nameOfVariable but for objects
what is the syntax for it please.

Tomáš Burzal 10 months ago
  • Whitelisted Links