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))
})