Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sam Hulick
    @ffxsam
    oh wait. or does it just change the order property of the document in the collection..? so then I would fetch the items based on order using MyStuff.find({}, {sort: {order: -1}})
    jagi
    @jagi

    Yes documentation is not detailed enough. When you create a new document:

    var u = new User();

    You have to insert it into collection using:

    user.insertAt(0);

    You don't use the save() method.
    To get documents already sorted you have to use:

    User.find();

    Notice that it's the class constructor not collection.

    Sam Hulick
    @ffxsam
    ahh, interesting. ok. thanks!
    Sam Hulick
    @ffxsam
    one more Q. I noticed I get this additional _original object inside data I retrieve from mongo. I tried to exclude it via Things.find({}, {fields: {_original: 0}}).fetch() but it still comes through. is this costing me anything in terms of bandwidth? or is it something added on with astronomy that doesn't go through the DDP connection?
    I'm trying to limit as many fields as possible for network performance
    Frank Pimenta
    @frankapimenta
    I was going over the examples with flow router and somehow template.data.user.get() is not retrieving the data that comes with the form. any ideias?
    Sam Hulick
    @ffxsam
    @jagi Is there a way to do optimistic UI with Astronomy? To just do a save() on the client only.. and then later commit that on the server end?
    Gregory Schwedock
    @shwaydogg
    @ffxsam that's standard meteor unless i'm missing something. If you have the insecure package setup; use proper allow deny rules; or use a Meteor Method call that will just work
    Gregory Schwedock
    @shwaydogg
    @frankapimenta, may want to check your astronomy user class. If the fields don't match up exactly you won't pull the results from the DB. Check what is in the DB directly (one way to do so is set .find({},{transform:null})That's all I know to say with the info provided
    Frank Pimenta
    @frankapimenta
    @shwaydogg yes. The form has less fields than the object it is creating. timestamps are some of them. How do I use this when the fields in the form are of small number than all the fields of the object the form is supposed to create?
    Frank Pimenta
    @frankapimenta
    @shwaydogg I will explain the issue again because it is subject to many interpretations.
    I have a userForm template. This template do not have fields for all fields in the user object. But the User Astro class has all the fields of the user mongo db object with the exception of the field _id.
    When I fill the form to create a new user, the template.data.user object (reactive var) does not bring the information I input". The input fields come empty. On edition it brings the old values, not the changes.
    Frank Pimenta
    @frankapimenta
    I have my reactive var within autorun which subscribes the collection User as well.
    Gregory Schwedock
    @shwaydogg
    @frankapimenta probably best to make an example with your issue, show some of your code/ a repo or , make a stackoverflow question with such info. Otherwise we'll end up talking in circles describing it. (post the Stackoverflow link here if you do)
    Frank Pimenta
    @frankapimenta
    @shwaydogg I'm sorry. Your are right. Thank you for the understanding and interest. I will try to make a good example of it. But Today is just not a good day to me :(. Tomorrow.
    Luis Herranz
    @luisherranz
    I'd love a default Validators.url() validator :)
    loving astronomy so far btw
    Luis Herranz
    @luisherranz
    @jagi I have made a PR: jagi/meteor-astronomy-validators#37
    BTW, how are you testing the code? Are you?
    Frank Pimenta
    @frankapimenta
    I think it now it is better explained
    thank you
    crussi
    @crussi
    Hi Jagi, First off, you're work is AMAZING! You're so talented and I've been really enjoying working with Astronomy. Everything is going well and I'm in awe of your work. I'm having difficulty creating a relations. I've followed the documentation to the letter. I've read and re-read the documentation and even the source code. For some reason, my relations is always Null. I tried a very simple relation. Here is a small snippet:
       DelegateId: {
            type: 'string',
            default:''
        },
        Delegate: {
            type: 'string',
            default:'',
            transient: true
        },
        relations: {
            delegate: {
                type: 'one',
                class: 'Contact',
                local: 'DelegateId',
                foreign: '_id'
            }
        },
    My class Task has a DelegateId that relates to a Contact table's _id field. It can't get any easier. Any ideas what I might be doing wrong?
    Roman Kuba
    @codebryo
    Hey, does anyone know if it's possible to work with default Mongo ObjectIds in Astronomy? It seems to just fail, but not sure if there is a configuration one could change.
    Anders Ramsay
    @andersr
    Hi - where in the astronomy docs can I find info about setting/saving to the db using Meteor methods? (ie the equivalent of Meteor.call...)
    Sam Hulick
    @ffxsam
    Manjukb
    @Manjukb
    hello
    i have an issue while saving
    will get an error called
    Uncaught TypeError: Cannot read property '_clearModifiers' of nul
    i guess some issue in structure i have created but not able to figure it out :-(
    Pieter Venter
    @cyrus-za
    hi
    I am having a issue with SimpleSchema and Collection2 and I am looking at alternatives (such as astronomy) to maybe fix the issue. I have a MongoDB that is populated mainly by sources outside of Meteor, but the UI does allow a user to add to the collection (using autoform package for that). The problem is that the external sources uses Mongo.ObjectId() and Meteor uses string for _id. How do I change Meteor to use ObjectId? Can SimpleSchema handle that? If not, can Astronomy do it and how do I go about getting that done?
    Manjukb
    @Manjukb
    @cyrus-za check out this packagehttps://github.com/thiloplanz/v7files/wiki/Vermongo
    I'm not sure this will help you
    Pieter Venter
    @cyrus-za
    thanks, checking
    @Manjukb I don't get it
    Vermongo seems to be a tool that creates a old copy of documents in a database? How is that going to solve my problem?
    Serkan Durusoy
    @serkandurusoy

    @cyrus-za you first create your collection passing in the idGeneration option:

    MyCollection = new Mongo.Collection('mycollection', {idGeneration: 'MONGO'});

    and then use either simple-schema/collection2 or astronomy at will. Neither should complain.

    But beware of the Meteor.users collection which, by default always uses STRING id's and you cannot change that meteor/meteor#1834

    Manjukb
    @Manjukb
    hi
    i have a nested class which is generated dynamically
    i want to give different validation param
    how can i do this
    This message was deleted
    This message was deleted
    {code}
    var createContactAstroClass = function createContactAstroClass(name, defaultType) {
    return Astro.Class({
    name: name,
    fields: {
    type: {
    type: "string",
    default: defaultType || "personal"
    },
    value: {
    type: "string",
    }
    }
    });
    };
    Luis Herranz
    @luisherranz

    If I use this:

    var app = new App();
    Template.XXX.helpers({
      app() { return app; }
    });

    and later on I change app with set()... then validate() and then save()... things in the template are not-reactive:

    This won't update {{app.url}} if coming from that helper, even if it's saved in Minimongo via save().

    If I want it to be reactive, I have to change the helper to something like:

    Template.XXX.helpers({
      app() { return Apps.findOne(_id); }
    });

    with the _id of the previously saved app object.

    Do you have plans to make a new Astro object reactive by itself without having to change it for a Minimongo query after saving?

    Dave
    @macasas
    Hi everyone, trying to get my head around astronomy and replace my verbose UserProfile code. Pasted in the example User = Astro.Class({
    name: 'User',
    collection: Meteor.users, ......... and it is telling me Error: The "collection" property has to be an instance of the "Mongo.Collection" in the "User" Does anyone have any info on this, perhaps a work-around? Thanks