BUG : [TypeError]pkeys.includes is not a function
BUG : [TypeError]pkeys.includes is not a function
Caviar_liu
Posts: 1Questions: 1Answers: 0
I want to use Editor to connect my sqlite database in node.js, then something unpredicted([TypeError]pkeys.includes is not a function) happens. Here is part of my code. Can anyone give me a suggestion?
var db = require('knex')({
client:"sqlite3",
connection:{
filename:"E:\\Development\\UnifiedDashBoard\\g11n.db"
}
})
var editorServer = require('datatables.net-editor-server');
var
Editor = editorServer.Editor,
Field = editorServer.Field;
Validate = editorServer.Validate;
Format = editorServer.Format;
Options = editorServer.Options;
router.all('/caselist/', function(req, res, next) {
var year = req.query.year
var quarter = req.query.quarter
var product = req.query.product
//Read DB and get case list
var editor = new Editor(db,'predict');
editor.fields(
new Field('CaseNumber','CaseID'),
new Field('ServiceProduct_Name',"Product"),
new Field('Account_GEO__c',"Region"),
new Field('Subject',"Subject"),
new Field('Description',"Description"),
new Field('Category',"Category"),
new Field('Cause__c',"Cause")
);
//get caselist
editor.process(req.query)
.then( function () {
// ... process complete
res.header('Access-Control-Allow-Origin','*')
res.json(editor.data());
} ).catch(function(err){
console.log(err)
});
//await editor.process(req.body);
//res.header('Access-Control-Allow-Origin','*')
//res.json(editor.data());
});
This discussion has been closed.
Answers
What version of Node are you using please? Array.prototype.includes is in Node, but it will need to be a relatively recent version.
Allan