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
hi, have some questions with Class.findOne(). Can I add query inside the findOne() method?
Class.create({ name: ‘Settings’, fields: { userId: String, name: String } });
now I want to do is Class.findOne({userId: ‘hello’}); or Class.findOne({ name: ‘Hi’ }); is it possible?