为什么整个mysql结果集使用节点js以数组格式出现?

时间:2013-07-30 10:18:12

标签: json node.js

使用以下节点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"
  }
]

0 个答案:

没有答案