使用以下节点 js 脚本,我以数组格式获取整个 mysql 结果集。如何将其移除?
var pricingDetail = function(resourceIdentifiers,callback){
dbconnection.execute(function(err,response){
if(err){
throw err;
}
else
{
var selectqueryString = "call SP_ExposePricingDetailforUI('" + resourceIdentifiers + "')";
response.query(selectqueryString, function(err, result){
if(err) {
throw err;
}
else
{
callback(result);
}
});
}
});
};
结果 :
[
{
"ResourceIdentifier": "vm/hpcloud/nova/small",
"chargeAmount": 0.071,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.49,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.49,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.8,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.8,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.78,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
},
{
"ResourceIdentifier": "vm/hpcloud/nova/large",
"chargeAmount": 0.78,
"ChargeAmountUnit": "per hour",
"CurrencyCode": "USD"
}
]