<commit_before>'use strict';

var mongoose = require('mongoose'),
    Film = require('../models/film.model');

exports.findAll = function(req, res) {
    Film.find({}).sort({created: 1}).exec(function(err, films) {
        if (err) {
            console.error(err);
            res.status(400).json(err);
        } else {
            res.json(films);
        }
    });
};
exports.create = function(req, res) {
    var film = new Film(req.body);
    film.save(function(err) {
        if (err) {
            res.status(400).json({
                message: err
            });<commit_msg>Film created<commit_after>'use strict';

var mongoose = require('mongoose'),
    Film = require('../models/film.model');

exports.findAll = function(req, res) {
    Film.find({}).sort({created: 'desc'}).exec(function(err, films) {
        if (err) {
            console.error(err);
            res.status(400).json(err);
        } else {
            res.json(films);
        }
    });
};
exports.create = function(req, res) {
    var film = new Film(req.body);
    film.save(function(err) {
        if (err) {
            res.status(400).json({
                message: err
            });
{'fraction_non_alphanumeric': 0.1737649063032368, 'fraction_numerical': 0.011073253833049404, 'mean_word_length': 1.982233502538071, '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': '1547801', 'n_tokens_mistral': 376, 'n_tokens_neox': 365, 'n_words': 65}