2016-10-20

Meteor - Returning a value from a call to a server method

Meteor.call(
"method-name"
, arguments
, function( error, result ){
  //actions go here
}
);

2016-10-19

MongoDB - Count distinct values of a given field, given a query

This will retrieve the distinct values in a json string (docs object)"

db.COLLECTION_NAME.distinct( "field_to_count", {query});



This would simply retrieve the count of distinct items (not the entire object with the list of all distinct values):

db.COLLECTION_NAME.distinct( "field_to_count", {query}).length;



MongoDB - Count distinct values of a given field, given a query

This will retrieve the distinct values in a json string (docs object)"

db.COLLECTION_NAME.distinct( "field_to_count", {query});



This would simply retrieve the count of distinct items (not the entire object with the list of all distinct values):

db.COLLECTION_NAME.distinct( "field_to_count", {query}).length;



2016-10-05

Meteor - List package nested dependencies

I believe this was authored by someone by the name of Chris Fritz.

meteor list | grep ^[a-z] | tr -s ' ' | cut -d ' ' -f1,2 | tr -d '\*\+' | tr ':' '_' \
 | while read X Y; do \
      cat ~/.meteor/packages/$X/$Y/web.browser.json \
      | xargs -0 node -e "X = JSON.parse(process.argv[1]); \
            X.uses.forEach(function(d) { \
                console.log(\"$X\", \"$Y\", d.package, d.constraint); \
            })"; \
   done | sort


http://stackoverflow.com/questions/39841904/ironrouter-organize-your-meteor-application-coming-up-when-using-kadira-flow

Meteor - How to update all packages in one single command

meteor update --all-packages