const config = require('../config.json')
const db_connection = require('../database/connection.js')

module.exports.get_titles = async (req, res, next) => {
    try {
        const db = await db_connection.get_db()
        var titles = await db.collection('title').find().skip(parseInt(req.query.start)).limit(parseInt(req.query.count)).toArray()
        res.json(titles)
    } catch (e) {
        next(e)
    }
}