In my route I am trying to get the registers with a dynamic columns, than the client request the route like a "router.get('/get-by/'" than specify the field of my table...
I'm using like this
var field = req.body.field
Territory
.findOne({
where: {
field : req.params.id
}
})
but nothing works. Can anyone help me?
Try this. [field]
I'm using like this: