我正在尝试使用Node JS从我的MSSQL表中选择前1个记录。这是我正在使用的代码:
var qryString = "SELECT TOP 1 * FROM AppUsers";
db.getConnPoolPromise().then(function(connPool) {
var sqlRequest = new sql.Request(connPool);
return sqlRequest.query(qryString);
}).then(function(result) {
cb(null, result);
}).catch(function(err) {
console.log('Query Error' + err);
cb(err, null);
});
但这永远不会执行。控件始终转到“event.js”,错误详细信息为:
{
"message": "ERR wrong number of arguments for 'set' command",
"stack": "ReplyError: ERR wrong number of arguments for 'set' command at parseError (c:\\inetpub\\wwwroot\\NodeApp\\services\\nodejs\\node_modules\\redis-parser\\lib\\parser.js:193:12) at parseType (c:\\inetpub\\wwwroot\\NodeApp\\services\\nodejs\\node_modules\\redis-parser\\lib\\parser.js:303:14)",
"command ": "SET ",
"args": [
"auth - 1234 ",
{
"recordset": [{
"Id": "13892",
"Pin": "200757",
"CellPhoneNumber": "1234567890",
"CountryId": "1",
"UserId": "1234"
}]
},
"EX",
"43200"
],
"code": "ERR",
"name": "ReplyError"
}
这让我发疯了。不知道是什么问题? Whare是SET命令?我在本地运行Redis服务器并使用AWS CLI配置