在Amazon Cloud中,我创建了一个S3存储桶并配置了S3存储桶以存储计费报告。然后我创建一个每日结算报告,该报告将插入配置的S3存储桶中。我想在nodejs中编写一个作业,它将每天从S3存储桶中获取账单并将其导入我的数据库而不需要重复的lineitem(使用mongoDB和mongoImport函数将记录从csv文件导入数据库)。问题是我找不到每个lineitem的唯一键,所以我无法每天更新我的数据库。 示例对象:
{
"identity/LineItemId" : "rm7ubabfqxwsmmutpeljlwx6bfckcandfk4di77zjvspx36aohvq",
"identity/TimeInterval" : "2017-03-03T00:00:00Z/2017-03-04T00:00:00Z",
"bill/InvoiceId" : "",
"bill/BillingEntity" : "AWS",
"bill/BillType" : "Anniversary",
"bill/PayerAccountId" : "123",
"bill/BillingPeriodStartDate" : "2017-03-01T00:00:00Z",
"bill/BillingPeriodEndDate" : "2017-04-01T00:00:00Z",
"lineItem/UsageAccountId" : "123",
"lineItem/LineItemType" : "Usage",
"lineItem/UsageStartDate" : "2017-03-03T03:00:00Z",
"lineItem/UsageEndDate" : "2017-03-03T21:00:00Z",
"lineItem/ProductCode" : "AmazonS3",
"lineItem/UsageType" : "Requests-Tier1",
"lineItem/Operation" : "PutObject",
"lineItem/AvailabilityZone" : "",
"lineItem/ResourceId" : "Bucket Name",
"lineItem/UsageAmount" : 44.0000000000000000,
"lineItem/CurrencyCode" : "USD",
"lineItem/UnblendedRate" : 0.0000050000000000,
"lineItem/UnblendedCost" : 0.0002200000000000,
"lineItem/BlendedRate" : 0.0000050000000000,
"lineItem/BlendedCost" : 0.0002200000000000,
"lineItem/LineItemDescription" : "$0.005 per 1,000 PUT, COPY, POST, or LIST requests",
"lineItem/TaxType" : "",
"product/ProductName" : "Amazon Simple Storage Service",
"product/availability" : "",
"product/durability" : "",
"product/fromLocation" : "",
"product/fromLocationType" : "",
"product/group" : "S3-API-Tier1",
"product/groupDescription" : "PUT/COPY/POST or LIST requests",
"product/location" : "US East (N. Virginia)",
"product/locationType" : "AWS Region",
"product/maxIopsBurstPerformance" : "",
"product/maxIopsvolume" : "",
"product/maxThroughputvolume" : "",
"product/maxVolumeSize" : "",
"product/operation" : "",
"product/productFamily" : "API Request",
"product/servicecode" : "AmazonS3",
"product/sku" : "E9YHNFENF4XQBZR6",
"product/storageClass" : "",
"product/storageMedia" : "",
"product/toLocation" : "",
"product/toLocationType" : "",
"product/transferType" : "",
"product/usagetype" : "Requests-Tier1",
"product/volumeType" : "",
"pricing/publicOnDemandCost" : 0.0002200000000000,
"pricing/publicOnDemandRate" : 0.0000050000000000,
"pricing/term" : "OnDemand",
"pricing/unit" : "Requests",
"reservation/TotalReservedUnits" : "",
"reservation/UnitsPerReservation" : "",
"resourceTags/aws:createdBy" : ""
}