import { check } from 'meteor/check';
import { Mongo } from 'meteor/mongo'
import TransliterationDb from '../../collections/transliterationdb';
import { Counts } from 'meteor/tmeasday:publish-counts';

Meteor.publish("transliterationdb", function({ limit }) {
    if (!this.userId) {
        return this.ready();
    }


    check(limit, Number);
    return TransliterationDb.find({}, {
        sort: { ID: 1 },
        limit: limit
    });
});

Meteor.publish("transliterationdbCount", function() {
    if (!this.userId) {
        return this.ready();
    }
    Counts.publish(this, 'transliterationCount', TransliterationDb.find({}), { fastCount: true });
});