Query in a key-value list field DynamoDB - amazon-dynamodb

I'm attempting make a query in a field that is list of key-value, as below.
Unfortunatelly I'm novice in DynamoDB, sorry.
My goal is get a record using a filter like:
Where
TransactionParameterList.Name = "HOSTING_NR" and
TransactionParameterList.OPERATION = "1234"
It's possible?
How?
I'm using AWS .NET SDK
Regards!
"TransactionID": "657",
"TransactionInstanceIdentifier": "919C5A0E-8786-4B86-87BF-5080E2639406",
"TransactionParameterList": [
{
"Name": "HOSTING_NR",
"Value": "1234"
},
{
"Name": "OPERATION",
"Value": "GetData"
}
],
"TransactionStepID": "1491",
"TransactionStepInstanceIdentifier": "0B0763AB-A847-479D-8EFE-43B842F2B2EB"
}

As of now DynamoDB does not support querying list of map items.
workaround in discussion forum here

Related

Artifactory: how can I obtain a complete dump of all fields for an artifact?

I'm interested in the value of one field (Module ID) but there seems to be no way of obtaining this specifically. A complete dump of all field values would also suffice but I haven't succeeded in finding a way to do that either. I've looked at and tried the searches available within the documentation here: https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-SEARCHES
If it helps, I'm trying to query an on-premise installation of Artifactory.
More fields can be added to the AQL using the "include" element.
For example - to list all artifacts under "libs-release-local" repository, including their module names, run the following query:
items.find(
{
"repo":{"$eq":"libs-release-local"}
}
).include("artifact.module")
Response example:
{
"results": [
{
"repo": "libs-release-local",
"path": "org/jfrog/test/multi2/2.17.0",
"name": "multi2-2.17.0.jar",
"type": "file",
"size": 1022,
"created": "2021-09-11T13:51:33.878Z",
"created_by": "deployer",
"modified": "2021-09-11T13:51:33.631Z",
"modified_by": "deployer",
"updated": "2021-09-11T13:51:33.881Z",
"artifacts": [
{
"modules": [
{
"module.name": "org.jfrog.test:multi2:2.17.0"
}
]
}
]
}
]
}
You can find all of the required information under AQL documentation.

Can WooCommerce Api update stock quantities in bulk?

Is that possible to update the inventory/stock quanitity in bulk using WooCommerce API? From the documentation for every update we may need to call PUT /wp-json/wc/v3/products/. We have more than 1000 products, it is very inefficiency to call 1000+ api just to update the quatity?
If there is any other thoughts, please welcome to share. Thanks
You can use this endpoint wp-json/wc/v3/products/batch
{
"Update": [
{
"Id": "39",
"Default_attributes": [
{
"Id": null,
"Name": null,
"Sku": "NEW-SKU",
"StockQuantity": "5"
}
]
}
]
}
here is an example body

Azure Cosmos DB - order by a version string

Currently I have a list of documents in a collection. Each document has a version string field which I would like to order by. Although this example query does not work, I'm looking for something similar to the following. select * from p order by p.version desc I believe this may be possible using a stored procedure but is that the most efficient way if it is possible?
{
"productId": "...",
"version": "3.6.2",
"platform": "..."
},
{
"productId": "...",
"version": "2.2.1",
"platform": "..."
},
{
"productId": "...",
"version": "7.4.8",
"platform": "..."
},
{
"productId": "...",
"version": "2.2.6",
"platform": "..."
}
I'd like to sort based on the individual components of the version
rather than the version string as a whole.
Basically, we are told we can only sort with properties of document, not derived values.So,you can't sort data like order by substring(version,0,1).
2 ways as workaround:
1.Follow #Martion's suggestion: Split version according to . into three properties and add them into your documents so that you could sort them as normal.
2.Select three derived properties in sql:
SELECT substring(c.version,0,1) as major,substring(c.version,2,1) as minor,substring(c.version,4,1) as patch FROM c
Then sort the result in the code,like Array.Sort().

Is it possible to convert JSON Input while sending data from IOT hub to CosmosDb using Stream Analytics

I'm having JSON INPUT (Iot HUB)
{
"time": 1574266369775,
"latitude": 70.703271,
"longitude": 25.8445082,
"accuracy": 23.320999145507812,
"altitude": 498.8999938964844,
"id": "abs8d5c2ff74b5a5"
}
and want to store that into the cosmosDb, in particulate key location.
{
"updatedtime": 1574345877283,
"time": 1574347747884,
"status": "available",
"deviceId":"abs8d5c2ff74b5a5",
"location": {
"time": 1574266369775,
"latitude": 70.703271,
"longitude": 25.8445082,
"accuracy": 23.320999145507812,
"altitude": 498.8999938964844,
"id": "abs8d5c2ff74b5a5"
}
}
Is it possible? I'm able to store it into the first level but can it be store in the key of any document?
Stream Analytics integration with Azure Cosmos DB allows you to insert or update records in your container based on a given Document ID column. This is also referred to as an Upsert.
Documentation also says that it enables partial updates to the document, that is, addition of new properties or replacing an existing property is performed incrementally.
My 2 cents: try to name your output as 'location' and make sure you have the same document id when writing to the cosmos db output from your ASA job.

Freebase MQL query - Get data by a social link

I'm having a hard time trying to get data about a person from Freebase using his social link - by a MQL query.
How could this be done?
Something like:
https://www.googleapis.com/freebase/v1/mqlread?query={
"*":[{}],
"/common/topic/social_media_presence":[{
"value":"http://twitter.com/JustinBieber"
}]
}
Those links are really stored as keys and the links are generated from templates with they key plugged in. You can see all the keys here: https://www.freebase.com/m/06w2sn5?keys=
A modified version of your query would be:
[{
"key": [{
"namespace": {
"id": "/authority/twitter"
},
"value": "JustinBieber"
}],
"*": [{}]
}]
You can do the same thing with other namespaces like /authority/facebook or /authority/musicbrainz as well as the various language wikipedias e.g. /wikipedia/en
I'm not sure how complete the coverage or currency of the social media info is though...

Resources