This module or package is used to convert json format into a clause where sequelize. This makes it easier for you to create dynamic filter formats
npm i json2sequelize-clause
You can import library and use it for convert json to sequelize where clause
const User = require('./config')
const convert = require('json2sequelize-clause')
const clause = [
{
"column": "name",
"function_name": "contains",
"value": "Farcha",
"operator": "where"
},
{
"column": "age",
"function_name": ">",
"value": 21,
"operator": "or"
}
]
User.findAll({
where: convert(clauses.does_not_contains)
}).then(results => {
console.log(results)
})
For more example clause you can access here
- 1.0.3
- Update structure and recursive strategy
- 1.0.2
- Update documentation in README.md
- 1.0.1
- Update some attributes
- Create some test cases
- See commit change
- 1.0.0
- Initial Release
This project is licensed under the ISC License