Hello all,
The methods below generate a bunch of error that I have no idea what it is. Please advice what is wrong with the methods. Thanks in advance.
My Methods:
Meteor.methods({
getUnassignEmployees: function () {
let assignedEmployee = OutletEmployees.find({});
let assignedEmployeeIdArr = [];
assignedEmployee.forEach(data => {
assignedEmployeeIdArr.push(data.employee_id)
});
let unassignEmployees = Meteor.users.find({
_id: {
$nin: assignedEmployeeIdArr
}
})
return unassignEmployees
}
});
When call, it give following error:
W20181216-22:26:04.744(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
W20181216-22:26:04.783(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:594:27)
W20181216-22:26:04.783(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.783(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.783(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.784(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.784(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.784(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.785(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.785(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.785(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.785(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.786(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.786(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.786(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.786(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.787(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.787(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
W20181216-22:26:04.787(8)? (STDERR) (node:19196) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
W20181216-22:26:04.955(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
W20181216-22:26:04.955(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.955(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.956(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.956(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.956(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.956(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.956(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.956(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.957(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.957(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.957(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.958(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.958(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.959(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:04.959(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:04.959(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:04.959(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
W20181216-22:26:05.159(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
W20181216-22:26:05.160(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.161(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:05.161(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:05.161(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.162(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:05.162(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:05.163(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.163(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:05.163(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:05.163(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.164(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:05.164(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:05.164(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.164(8)? (STDERR) at Object.EJSON.clone.v [as clone] (packages/ejson/ejson.js:594:18)
W20181216-22:26:05.165(8)? (STDERR) at Object.keys.forEach.key (packages/ejson/ejson.js:595:22)
W20181216-22:26:05.165(8)? (STDERR) at Array.forEach (<anonymous>)
W20181216-22:26:05.166(8)? (STDERR) (node:19196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)