<commit_before>var db = db.getSiblingDB('raspimon');

var mapfn = function() {
    b = this.basetime;
    for(i=0; i<this.values.length; ++i) {
        emit(new Date(b.getTime()+this.delta_times[i]*1000.0), this.values[i]);
    }
};

var reducefn = function(key,values) {
    return values[0];
};

db.GVA2015_data.mapReduce(mapfn, reducefn,
                          {
                              "query" : { "topic" : /.*plugwise.*tel.*/ },
                              "out" : { "inline":1}
                          })<commit_msg>Updated mapreduce example<commit_after>var db = db.getSiblingDB('raspimon');

var mapfn = function() {
    var b = this.basetime;
    var t = this.topic;
    for(i=0; i<this.values.length; ++i) {
        emit(new Date(b.getTime()+this.delta_times[i]*1000.0), this.values[i]);
    }
};

var reducefn = function(key,values) {
    return values[0];
};

db.result.drop();

db.GVA2015_data.mapReduce(mapfn, reducefn,
                          {
                              "query" : { "topic" : /.*rfemon.*grid.*real.*/ },
                              "out" : "result"
                          });
{'fraction_non_alphanumeric': 0.1696113074204947, 'fraction_numerical': 0.020318021201413426, 'mean_word_length': 1.75669099756691, 'pattern_counts': {'":': 1, '<': 5, '<?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': '4663873', 'n_tokens_mistral': 396, 'n_tokens_neox': 382, 'n_words': 59}