{"size": 309, "ext": "js", "max_stars_repo_path": "server/collections/hooks/notes/beforeInsert.js", "max_stars_repo_name": "gsantoshb/Exartu-CRM", "max_stars_repo_stars_event_min_datetime": "2015-09-08T20:28:36.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-06T05:24:57.000Z", "max_issues_repo_path": "server/collections/hooks/notes/beforeInsert.js", "max_issues_repo_name": "gsantoshb/Exartu-CRM", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/collections/hooks/notes/beforeInsert.js", "max_forks_repo_name": "gsantoshb/Exartu-CRM", "max_forks_repo_forks_event_min_datetime": "2016-04-11T09:11:59.000Z", "max_forks_repo_forks_event_max_datetime": "2018-05-09T08:29:26.000Z"}
{"max_stars_count": 10, "max_issues_count": null, "max_forks_count": 10, "avg_line_length": 23.7692307692, "max_line_length": 87, "alphanum_fraction": 0.6731391586}

Notes.before.insert(function(userId, doc){
  doc.dateCreated = doc.dateCreated || Date.now();
  if (doc.hierId)
    return doc; // It was created by the system, e.g.: from a SMS sent by a contactable

  var user = Meteor.user();
  doc.hierId = user.currentHierId;
  doc.userId = user._id;

  return doc;
});
