this
should be replaced with e.currentTarget
.
Why is this:
update({Meteor, LocalState}, data) {
Meteor.call('companies.find', data._id, (err, res) => {
if (err) {
return LocalState.set('COMPANY_FIND_ERROR', err.message);
} else {
let comp = res;
comp.modifiedBy = Meteor.user().username;
comp.name = data.name;
comp.compNum = data.compNum;
comp.addressOne = data.addressOne;
comp.addressTwo = data.addressTwo;
comp.addressThree = data.addressThree;
comp.addressFour = data.addressFour;
comp.addressDisplay = data.addressDisplay;
comp.country = data.country;
comp.phone = data.phone;
comp.email = data.email;
comp.fax = data.fax;
Meteor.call('companies.add', comp, (err1, res1) => {
if (err) {
console.log('Error Detected: ', err1.message);
return LocalState.set('COMPANY_ADD_ERROR', err1.message);
} else {
console.log('Successfully saved!', res1);
}
});
}
});
giving me:
E11000 duplicate key error collection: meteor.companies index: _id_ dup key: { : \\"GyiJ4bcv7jT98mBba\\" }"
undefined
when they were queried by their parent class. For example like let child = Parent.findOne({_id: childId})
leads to child.childAttribute === undefined
, when childAttribute
is set and defined in the fields
of the Child = Parent.inherit(…
class. Is this intended?
Insights.find().fetch()
into a React component.. yet it has NONE of the properties an Insight has, and instead has the same properties a Tag model does, which is label
console.log(Insights.find().fetch())
, then the right data is passed into the React component
instanceof Tag
on that class, it says true
. what the heck?!
find
method, it's screwing another model's schema
Hello,
W20161012-12:28:17.508(1)? (STDERR) debugger listening on port 5858
I20161012-12:28:19.829(1)? Resolve cb threw Maximum call stack size exceeded
W20161012-12:28:19.831(1)? (STDERR)
W20161012-12:28:19.831(1)? (STDERR) /home/jlacey/.meteor/packages/meteor-tool/.1.3.5_1.1bjykex++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20161012-12:28:19.832(1)? (STDERR) throw(ex);
W20161012-12:28:19.832(1)? (STDERR) ^
W20161012-12:28:19.832(1)? (STDERR) RangeError: Maximum call stack size exceeded
I get a maximum call stack error in astronomy@2.1.1 and greater
However I do not get it in 2.1.0
I've found the piece of code which is causing the problems, I have this model called AS.Object
which has a field that has a type of AS.Object
. I also Have another field which has a type of [AS.Object]
.
Has anything changed in how the types are resolved between 2.1.0 and 2.1.1?
Hi;
I'm trying to use Astronomy together with the new grapher package https://github.com/cult-of-coders/grapher
It's working fine so far but I'm not quite sure how to handle transformation of documents in Astronomy 2.x
As grapher fetches the documents, I'd had to change the grapher code to use astronomies find/findOne... methods.
What I did instead: Added a transform function to every collection.
transform(doc) {
const t = new MyAstroClass(doc)
t._isNew = false
return t
},
This works fine but I'm unsure if this is a good solution. What are the reasons for Astronomy to drop Collection transforms in 2.x?
Is it just to make it optional or to avoid side effects?
Is it "safe" to use this kind of transform?
Thanks in advance