<commit_before>var ngMongo = angular.module("ngMongo",['ngResource']);

ngMongo.config(function($routeProvider){
  $routeProvider
      .when("/",{
        templateUrl : "list-template.html",
        controller : "ListCtrl"
      })
  ;
});

ngMongo.factory("Mongo",function($resource){
  return {
    database : $resource("/mongo-api/dbs"),
    collection : $resource("/mongo-api/:database")
  }
});

ngMongo.directive("deleteButton", Tekpub.Bootstrap.DeleteButton);
ngMongo.directive("addButton", Tekpub.Bootstrap.AddButton);

ngMongo.controller("ListCtrl", function($scope, $routeParams, Mongo){
  console.log($routeParams);
  var context = "database";
  if($routeParams.database) context = "collection";

  $scope.items = Mongo[context].query($routeParams);

  $scope.addItem = function(){<commit_msg>Oops - THIS is Episode 4<commit_after>var ngMongo = angular.module("ngMongo",['ngResource']);

ngMongo.config(function($routeProvider){
  $routeProvider
      .when("/",{
        templateUrl : "list-template.html",
        controller : "ListCtrl"
      })
      .when("/:database", {
        templateUrl : "list-template.html",
        controller : "ListCtrl"
      })
      .otherwise({
        template : "<h1>Not Found</h1>"
      })
  ;
});

ngMongo.factory("Mongo",function($resource){
  return {
    database : $resource("/mongo-api/dbs"),
    collection : $resource("/mongo-api/:database")
  }
});

ngMongo.directive("deleteButton", Tekpub.Bootstrap.DeleteButton);
ngMongo.directive("addButton", Tekpub.Bootstrap.AddButton);

ngMongo.controller("ListCtrl", function($scope, $routeParams, Mongo){

  var context = "database";
  if($routeParams.database) context = "collection";

  $scope.items = Mongo[context].query($routeParams);

  $scope.addItem = function(){
{'fraction_non_alphanumeric': 0.17474633596392333, 'fraction_numerical': 0.0016910935738444193, 'mean_word_length': 4.205278592375366, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3499212', 'n_tokens_mistral': 567, 'n_tokens_neox': 557, 'n_words': 81}