Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Adalberto Soares
    Maybe you are getting the object with Cars.find() (Collection) and not like Car.find() (Astronomy Class)
    M. Aufa Husen R.
    im trying to create/insert a new one to db
    and yes i've refer to the astronomy class correctly
    Ścibor Rudnicki
    Hi, i am trying to use astronomy, but i have got an error: 404, reason: "Method '/Astronomy/insert' not found". Actually i use simpleSchema and Collection2 with success.
    i thought that i should define /Astronomy/insert method, so i did it, and i get Uncaught Error: A method named '/Astronomy/insert' is already defined
    @Diabeu27 you're missing some imports. Check everything one more time
    Ścibor Rudnicki
    mhmm, i will check it again
    okaay, i see you are from poland, poznań here
    Sam Hulick
    has anyone else had issues with Astronomy 2, where the results of a .find().fetch() of one item starts to mix properties with a completely different data model?
    e.g., I'm passing the results of 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
    makes no sense
    yet in the Meteor container, if I just do a console.log(Insights.find().fetch()), then the right data is passed into the React component
    which, again, makes no sense
    Sam Hulick
    so for instance, this is the actual schema (part of it) for Insight:
    and here's how it's actually showing up when I console.log it in Chrome:
    and if I do instanceof Tag on that class, it says true. what the heck?!
    Sam Hulick
    I narrowed it down. in my Meteor container's return statement, if I change availableTags: Tag.find({}, alphaSort).fetch(), to use Tags (Mongo, directly) instead, everything works great
    so just by using Astronomy's find method, it's screwing another model's schema
    Sam Hulick
    ugh. I just found out that <astro item>.constructor.className is also incorrect. ok.. so it seems Astronomy v2 has some serious issues when doing several find calls in a container on different collections. bummer :(
    @ffxsam Would be very interesting to see a repro.
    Sam Hulick
    @arggh fixed: jagi/meteor-astronomy#496
    Robbie Reynolds
    While trying to learn Astronomy, I'm noticing a mix of v1.x and v2.x examples and I'm getting confused as to what's what. Is there an official 2.x docs or repo?
    In the left sidebar you should be able to open V1 and V2 docs separately.
    ..Though I think the new docs are not really finished and probably have some relics from V1.
    Santiago Galindo
    Hi I'm kooking for a way to define relationships between collections (one to many, many to many) and keep data integrity, so when I delete and object related by id to another collection, then that document will be deleted automatically.
    Is it possible to handle this with astronomy?
    Jake Lacey
    This message was deleted
    Jake Lacey


    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?

    I'm going to create a test case for this, but I just wanted to ask in advance
    thanks :)
    Jake Lacey
    Hi I've created the test case,
    I'll be creating the issue soon
    Jake Lacey

    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

    @jagi regarding Enums, is there any explanation for this: "You can also define non number ENUMs, however it’s not recommended.", other than the fact that using Strings takes more space?
    Trying to use Astronomy's Enums in an app that utilizes HTML Select elements causes difficulties, when the Enum's integer values are cast into strings. Would be convenient to use just strings all the way. Also, the data in the Mongo collection would be more self-explanatory: compare [0, 1, 2] to ['YES', 'NO', 'MAYBE']. Any thoughts?
    hi guys, thank you for a wonderful package :D
    i had one question for the more advanced users here, could i use transient fields or resolve to have, well, basically relations ? as in fetch a field from another collection into a field in the current collection?
    would that be impossible? bad? crap performance? etc?
    Bryant Biggs
    hello everyone - if I have a form split up in sections where after each section clicks "Next" or something, how can I define a schema that will allow a gradual build-up of the document? If I define the schema and the first form only fills in 4 of N inputs, the validation fails because its missing the other inputs
    @bryantbiggs 1) Keep the data stored elsewhere until the document is ready to be saved 2) Set the fields as optional, so they are not validated if they don't exist

    I just started to use astronomy when I am trying to save my folder collection am getting some error which is below

    [Exception: TypeError: Cannot read property '_id' of undefined at

    Am i missing anything in configuration ? Thank you in advance

    Bryant Biggs
    @arggh thank you for the response but I was able to resolve the issue by saving the document as the base class type for the first form submission, then on the 2nd form submission I updated the class type from the base to the child class and stored the remaining information. This kept all of the validation and required fields intact in their respective classes
    Alexis A. Banaag Jr.

    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?

    Andrew Hartwig
    Yes, but you also need a { collection: new Mongo.Collection('settings') } key in there.
    which version of regex does it support?
    I am trying to find a suitable regex expression for URLs