fix minor bug with Collection.createQuery()

This commit is contained in:
Theodor Diaconu 2017-11-27 01:42:39 +02:00
parent 58864d4960
commit c1716591a9
2 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,7 @@ export default (...args) => {
let name;
let body;
let rest;
if (typeof args[0] == 'string') { //NamedQuery
if (typeof args[0] === 'string') { //NamedQuery
name = args[0];
body = args[1];
rest = args.slice(2)

View file

@ -1,8 +1,11 @@
import Query from './query.js';
import NamedQuery from '../namedQuery/namedQuery.js';
import NamedQueryStore from '../namedQuery/store.js';
_.extend(Mongo.Collection.prototype, {
createQuery(...args) {
if (args[0] == 'string') { //NamedQuery
if (typeof args[0] === 'string') {
//NamedQuery
const name = args[0];
const body = args[1];
const params = args[2];
@ -11,7 +14,8 @@ _.extend(Mongo.Collection.prototype, {
NamedQueryStore.add(name, query);
return query;
} else { //Query
} else {
//Query
const body = args[0];
const params = args[1];