我有 resultMp3 给我这个:
"mp3": {
"33274": {
"idSon": 33274,
"description": "Techno Music",
"Typenom": "Billboard",
},
"33275": {
"idSon": 33275,
"description": "Techno Music",
"Typenom": "Pub Cd/Dvd",
}
},
我想简单地按 id 删除过滤器,所以结果将是这样的
"mp3": {
{
"idSon": 33274,
"description": "Techno Music",
"Typenom": "Billboard",
},
{
"idSon": 33275,
"description": "Techno Music",
"Typenom": "Pub Cd/Dvd",
}
},
到目前为止,这是我的功能。结果没问题,但我的问题是我想删除 Id 并仍然使用它进行过滤:
let resultMp3 = {};
let sqlPromise = await new Promise(function (resolve, reject) {
var ds = app.datasources.mydb;
var sql = `....`;
ds.connector.execute(sql, [], function (err, cm_comediens_extraits_mp3s) {
if (cm_comediens_extraits_mp3s.length === 0){
resultMp3 = {}
}else{
for(var i=0; i<cm_comediens_extraits_mp3s.length;i++){
let extraitMp3 = cm_comediens_extraits_mp3s[i];
let mp3 = {};
mp3["idSon"] = extraitMp3.idSon;
mp3["description"] = extraitMp3.description;
mp3["Typenom"] = valueList[extraitMp3.type].fr;
resultMp3[extraitMp3.idSon] = mp3;
}
}
resolve(resultMp3);
});
});
result.mp3=resultMp3;
任何帮助,将不胜感激。
肥皂起泡泡
倚天杖
相关分类