<commit_before>const router = require('express').Router();
const Mood = require('../models/mood');

router
    .get('/moods/', (req, res, next) => {
        Mood.find()
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/', (req, res, next) => {
        const date = req.query.date;
        Mood.find()
            .where('date', date)
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/zipcode/', (req, res, next) => {
        const zipcode = req.query.zipcode;
        Mood.find()
            .where('zipcode', zipcode)
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/description/', (req, res, next) => {
        const description = req.query.description;
        console.log('description', description);
        Mood.find()
            .where('weather.description', description)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/city/', (req, res, next) => {
        const city = req.query.city;
        Mood.find()
            .where('weather.city', city)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/state/', (req, res, next) => {
        const state = req.query.state;
        Mood.find()
            .where('weather.state', state)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/country/', (req, res, next) => {
        const country = req.query.country;
        Mood.find()
            .where('weather.country', country)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/types', (req, res, next) => {
        const type = req.query.type;
        Mood.distinct(type)
        .then(moods => res.send(moods))
        .catch(next);
    });

module.exports = router;
<commit_msg>can filter by date and restore all users<commit_after>const router = require('express').Router();
const Mood = require('../models/mood');

router
    .get('/moods', (req, res, next) => {
        Mood.find()
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/date', (req, res, next) => {
        const date = req.query.date;
        Mood.find()
            .where('date', date)
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/zipcode', (req, res, next) => {
        const zipcode = req.query.zipcode;
        Mood.find()
            .where('zipcode', zipcode)
            .populate('block color')
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/description', (req, res, next) => {
        const description = req.query.description;
        console.log('description', description);
        Mood.find()
            .where('weather.description', description)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);
    })
    .get('/moods/city', (req, res, next) => {
        const city = req.query.city;
        Mood.find()
            .where('weather.city', city)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/state', (req, res, next) => {
        const state = req.query.state;
        Mood.find()
            .where('weather.state', state)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/country', (req, res, next) => {
        const country = req.query.country;
        Mood.find()
            .where('weather.country', country)
            .populate('block color')            
            .then(moods => res.send(moods))
            .catch(next);               
    })
    .get('/moods/types', (req, res, next) => {
        const type = req.query.type;
        Mood.distinct(type)
        .then(moods => res.send(moods))
        .catch(next);
    });

module.exports = router;

{'fraction_non_alphanumeric': 0.16963304768182816, 'fraction_numerical': 0.0, 'mean_word_length': 1.5121412803532008, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '190802', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1410, 'n_words': 251}