You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the full working example that leads to the following error.
The problem is that company defines a field named employees but in the example I am trying to assign a value to employee.
I was hoping that programmer errors like these would be part of the errors that the ORM/ODM would catch.
RangeError: Maximum call stack size exceeded
at deepCopy (/Users/kelvin/node_modules/nedb/lib/model.js:128:22)
at /Users/kelvin/node_modules/nedb/lib/model.js:130:18
at Array.forEach (native)
at deepCopy (/Users/kelvin/node_modules/nedb/lib/model.js:128:22)
at /Users/kelvin/node_modules/nedb/lib/model.js:130:18
at Array.forEach (native)
at deepCopy (/Users/kelvin/node_modules/nedb/lib/model.js:128:22)
at /Users/kelvin/node_modules/nedb/lib/model.js:122:41
at Array.forEach (native)
at deepCopy (/Users/kelvin/node_modules/nedb/lib/model.js:122:9)
Your Employee class shoul extend the EmbeddedDocument class which needs to be pulled in.
//add this to top
var EmbeddedDocument = require('camo').EmbeddedDocument;
//change this
class Employee extends Document {
//to this
class Employee extends EmbeddedDocument {
//change this
var uri = 'nedb://companies';
//to this
var uri ='nedb:///companies';
Im also not sure you can have circular references like the employee.company tryin to save an employee object inside a company object that has an array of an employee object is probably not going to work. Other than that your code looks good to me.
Below is the full working example that leads to the following error.
The problem is that company defines a field named
employees
but in the example I am trying to assign a value toemployee
.I was hoping that programmer errors like these would be part of the errors that the ORM/ODM would catch.
The text was updated successfully, but these errors were encountered: