MySQL错误5154:无效占位符(Node.js XDevAPI连接器)
我目前正在使用MySQL服务器(版本8.0.12),并通过支持XDevAPI和NoSQL的官方Node.js MySQL连接器连接到它。我试图从数据库中提取一些博客文章,但得到错误5154 这是我的密码:MySQL错误5154:无效占位符(Node.js XDevAPI连接器),mysql,node.js,nosql,Mysql,Node.js,Nosql,我目前正在使用MySQL服务器(版本8.0.12),并通过支持XDevAPI和NoSQL的官方Node.js MySQL连接器连接到它。我试图从数据库中提取一些博客文章,但得到错误5154 这是我的密码: // Data used const postsPerPage: number; const start: number; let results: BlogPost[] = []; await blogPosts .find('accountID = :accountID')
// Data used
const postsPerPage: number;
const start: number;
let results: BlogPost[] = [];
await blogPosts
.find('accountID = :accountID')
.bind('accountID', req.account.id)
.sort('posted ASC')
.limit(postsPerPage + 1)
.offset(start)
.execute(post => {
results.push(post);
});
事实证明,
req.account.id
此时实际上是未定义的。我的输入数据有点乱