Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Pieter Venter
    @cyrus-za
    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
    Sorry, getting confused.... I think this is related to the accounts package not being installed in the astro example. As you were :-)
    Sam Hatoum
    @samhatoum
    See herE:
    @macasas
    Dave
    @macasas
    @samhatoum Thanks for your reply, this is the repo that first informed me about astronomy. I have seen this example in a number of places now, all similar in form but while I can use astronomy for other collections I have so far been unsuccessful in replacing my sign up process to create a suitable Meteor user. I am using Meteor.createUser with options filled from a form to trigger Accounts.onCreateUser which is sending verification emails. When I add the nested UserProfile class it gets saved in mongo as EJSON classes. I know I'm doing something wrong, need to play more with astronomy because everyone is saying the same thing about how to do it, but it just isn't working for me. I will return to this repo and read more. Thanks.
    negamaxi
    @negamaxi
    Hi there guys, this package is awesome!! Can someone explain Astro schemas validate field types by default or I need to manualy attach validators to each field? Thanks!
    Jernej Jerin
    @jeryini
    hi!
    I am looking at documentation for Custom Types
    and examples of array_field.js and object_field.js
    but still have hard time building a custom type set
    I want to have a support for Set object
    I tried to use the code from array_field, but with not much sucess. Acctually it did store something in the document for that field, but it looks broken :)
    also @jagi thank you very much for this super great package
    Jernej Jerin
    @jeryini
    I have created a separate help topic on official Meteor forums if someone is willing to help https://forums.meteor.com/t/implementing-custom-type-in-astronomy/16266?u=jeryslo
    Tim Cooper
    @tjscooper
    Moving to Astronomy 2... Doing type checks I uncovered (not confirmed entirely) a difference between fields set with and without default.
    i.e.
    orderId: String validates as String
    orderId: { type: String, default: 'test' } validates only as 'string'
    Tim Cooper
    @tjscooper
    @jagi Have I uncovered a type conversion issue there?
    Tbutnyakov
    @Tbutnyakov
    Hey!
    What about relations? Is it work in this version? Example from docs didn't work:(
    Darko Mijić
    @darko-mijic
    Hi @jagi. I havent been here for a wihile. Can you drop me a quick note in what phase is Astronomy 2, is it currently usable and what do you have in mind for a release date. I will start using it in new client project that is starting tomorrow, so I need your pointers regarding should I try v2 for this project. Do You need help with work on a v2 branch of meteor-astronomy-examples?
    Sharry Stowell
    @molinto
    Hi guys, it it possible to have Validators.or on two fields:
    if email is present use that, if phone is present use that else fail the insert
    Tim Cooper
    @tjscooper
    Does anyone know how to access arguments passed into Astronomy 2 methods?
    It used to be on a “.data” object, has this changed @jagi ?
    maco144
    @maco144
    how do i set to a Class a variable containing fields/values?
    'createMatch': function(gameSelected, gameDetails){
        var gameRules = new GameRule();
        gameRules.set(gameDetails);
        gameRules.save();
            var gameDetails = ({
              winning: $('#matchTeam').val(),
              achieved: $('#matchAchieved').val(),
              objective: $('#matchObjective').val()
            });
    maco144
    @maco144
    hmm that works now but didnt before... unsure what i changed...
    maco144
    @maco144
    im switching from autoform. Shouldnt this be how I close out a modal that has my form?
            afterInit() {
                $('#generalModal').modal('hide');
            }
    this is what I had to do before
    var matchFormHook = {
        onSuccess: function(insert,result){
            if(result)
                $('#generalModal').modal('hide');
        }
    }
    AutoForm.addHooks('matchDetails', matchFormHook);
    maco144
    @maco144
    how to use jquery on element after insert/update? is there a good example or docs?
    jagi
    @jagi
    You should
    @maco144 you shouldn't mix model layer with the view layer. The best places to pot such code is controller. So it would be done meteor method callback that is saving a document
    Hamatek
    @Hamatek
    @jagi before I open an issue have you tried meteor1.3 beta 4 ? I can't get astronomy to work , I get a build error Error: The "collection" property has to be an instance of the "Mongo.Collection" in the "Game" class
    Hamatek
    @Hamatek
    I open the an issue ~ jagi/meteor-astronomy#268
    peterchoo
    @peterchoo

    hi @jagi

    I've got a quick question regarding calculated fields. I've got a schema, and we are implementing some server-side filtering, sorting and pagination. Because of this, we need to have a lower-case version of certain text fields. What would be your recommended method for this? My current thought is to populate e.g. subject_lc with beforeSave: function(e) { this.subject_lc = this.subject.trim().toLowerCase(); }.

    Is this the best way to go about this? Thanks!

    peterchoo
    @peterchoo
    this.set('subject_lc', this.subject.trim().toLowerCase()); ?