<commit_before>var express = require('express');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var router = express.Router();

// Song database schema and model
var Song = new Schema({
  name: String
});
var Songs = mongoose.model('Song', Song);

// List
router.get('/', function(req, res) {
  Songs.find({}, function(err, songs) {
    if(err) {
      res.send('Error');
    }
    res.json(songs);
  });
});

// Create
router.post('/', function(req, res) {
  var song = new Songs(req.body);
  song.save(function(err) {
    if(err) {
      res.send('Error');
    }
    res.send('OK');
  });
});

// Read
router.get('/:id', function(req, res) {
  Songs.findById(req.params.id, function(err, song) {
    if(err) {
      res.send('Error');
    }
    res.json(song);
  });
});

// Update
router.put('/:id', function(req, res) {
  Songs.findById(req.params.id, function(err, song) {
    var song = new Songs(req.body);
    song.save(function(err) {<commit_msg>Changed update to remove using http body song<commit_after>var express = require('express');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var router = express.Router();

// Song database schema and model
var Song = new Schema({
  name: String
});
var Songs = mongoose.model('Song', Song);

// List
router.get('/', function(req, res) {
  Songs.find({}, function(err, songs) {
    if(err) {
      res.send('Error');
    }
    res.json(songs);
  });
});

// Create
router.post('/', function(req, res) {
  var song = new Songs(req.body);
  song.save(function(err) {
    if(err) {
      res.send('Error');
    }
    res.send('OK');
  });
});

// Read
router.get('/:id', function(req, res) {
  Songs.findById(req.params.id, function(err, song) {
    if(err) {
      res.send('Error');
    }
    res.json(song);
  });
});

// Update
router.put('/:id', function(req, res) {
  Songs.findById(req.params.id, function(err, song) {
    song.save(function(err) {
{'fraction_non_alphanumeric': 0.2021604938271605, 'fraction_numerical': 0.0, 'mean_word_length': 3.2841409691629955, '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': '4948768', 'n_tokens_mistral': 686, 'n_tokens_neox': 689, 'n_words': 145}