import Worklist from '../../collections/worklist.js';
import { check } from 'meteor/check';

Meteor.publish("worklist", function(devicemap) {

    if (!this.userId) {
        return this.ready();
    }

    const userid = this.userId;
    check(devicemap, String);
    // console.log(Worklist.find({ _userid: userid, _devicemap: devicemap }).fetch())
    return Worklist.find({ _userid: userid, _devicemap: devicemap }, { fields: { _devicemap: 0, _userid: 0 } });
});