我在观看ruby on rails教程时发现了以下表格结构.
table actors
id int 11 primary key auto_increment
name varchar 30
table movies
id int 11 primary key auto_increment
name varchar 30
table actors_movies
actor_id int 11
movie_id int 11
Run Code Online (Sandbox Code Playgroud)
如何查询选择演员参与的电影?
我不是要求rails上的ruby代码.我想要实际的mysql查询字符串.
谢谢!
我的迁移文件变得非常大,我很好奇是否有一种方法可以将迁移文件与 TypeORM 压缩成一个文件,而无需求助于纯 SQL。
我想通过clientSchema中的属性'token'查询子文档数组.但是我无法填充子文档数组.它总是返回空值.
这就是我的尝试
var performAuthAsync = promise.promisify(performAuth);
var response = {};
performAuthAsync(req).then(function (client) {
sendStatus(res, 200, { "success": "true", "value": client });
}).catch(ApiError, function (e) {
response.error = "true";
response.message = e.message;
if (e.message == "Invalid Authorization" || e.message == "Unauthorized access") {
console.log(e.message);
sendStatus(res, 401, response, req.query.type);
}
else {
sendStatus(res, 500, response, req.query.type);
}
});
Run Code Online (Sandbox Code Playgroud)
PerformAuth方法
function performAuth(req, callback) {
try {
var authHeader = req.headers.authorization;
console.log(authHeader);
//error in req format
if (!authHeader || !authHeader.startsWith("Basic ")) {
console.log("inside fail …Run Code Online (Sandbox Code Playgroud) express ×1
fetch-api ×1
many-to-many ×1
mongodb ×1
mongoose ×1
mysql ×1
node.js ×1
postgresql ×1
reactjs ×1
sql ×1
subdocument ×1
typeorm ×1