Paste log next and previous MongoDB

0

I have a endpoint that returns all the data of a post , but I would like to get information from the next record and the previous one to have two buttons ( Anterior and Proximo ).

My current query is like this

router.get('/search', (req, res, next) => {
    Post.find({queryString: req.query.id}).exec()
    .then(response => {
        res.send(response)
    })
    .catch(err => console.log(err))
})
    
asked by anonymous 16.07.2018 / 20:18

0 answers