import { check } from 'meteor/check';
import { Mongo } from 'meteor/mongo'
import Collections from '../../collections/worklist4hislink.js';

Meteor.publish("worklist4hislink", function(brand) {
    debugger
    if (brand == null) {
        return [];
    }
    if (!this.userId) {
        return this.ready();
    }
    const userid = this.userId;
    check(brand, String);

    // let Worklist = new Mongo.Collection(brand);
    // console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch())
    return Collections[brand].find({}, {
        disableOplog: true,
        // pollingThrottleMs: 1000,
        pollingIntervalMs: 1000
    });
});