<commit_before>/*
 * MODEL
 */
exports.model = {
  limit: function(limit, offset){
    var self = this.chain();
    offset = offset || 0;
  
    self.setInternal('limit', limit);
    self.setInternal('offset', offset);
  
    return self;
  }
};



/*
 * DEFINITION
 */
exports.definition = {
  mixinCallback: function(){
     
    this.beforeFind(function(query){
      var limit = this.getInternal('limit');
      var offset = this.getInternal('offset');
      
      if(limit){
        query.limit(limit);
        query.offset(offset);
      }
      
      return true;
    });
    
    
    this.afterFind(function(data){
      var limit = this.getInternal('limit');
      
      if(limit == 1){
        data.result = data.result[0];
      }
      
      return true;
    }, 50);
    
  }
};<commit_msg>changed limit priority<commit_after>/*
 * MODEL
 */
exports.model = {
  limit: function(limit, offset){
    var self = this.chain();
    offset = offset || 0;
  
    self.setInternal('limit', limit);
    self.setInternal('offset', offset);
  
    return self;
  }
};



/*
 * DEFINITION
 */
exports.definition = {
  mixinCallback: function(){
     
    this.beforeFind(function(query){
      var limit = this.getInternal('limit');
      var offset = this.getInternal('offset');
      
      if(limit){
        query.limit(limit);
        query.offset(offset);
      }
      
      return true;
    });
    
    
    this.afterFind(function(data){
      var limit = this.getInternal('limit');
      
      if(limit == 1){
        data.result = data.result[0];
      }
      
      return true;
    }, 60);
    
  }
};
{'fraction_non_alphanumeric': 0.1503388786198398, 'fraction_numerical': 0.0061614294516327784, 'mean_word_length': 1.9798165137614678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2451169', 'n_tokens_mistral': 523, 'n_tokens_neox': 508, 'n_words': 92}