rdio-scanner/server/imports/methods/calls-count.ts
Chrystian Huot 7c2ee69151 first commit
2019-06-12 11:43:21 -04:00

12 lines
321 B
TypeScript

import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';
import { Calls } from '../../../imports/collections/calls';
Meteor.methods({ 'calls-count': callsCount });
function callsCount(selector: any = {}): number {
check(selector, Object);
return Calls.collection.find(selector).count();
}