I want to update a Map Object in DynamoDB by adding another map object to it.
Here they add a single key value pair to a map. I want to add multiple key value pairs to a map in one request. There should be something like map_append similar to list_append. How can I do this? I went through the docs but could not find anything similar.
Thanks in advance!
Just use multiple SET update expressions separated by commas, following the example of the question you cited. SET map.#number1 = :string1, map.#number2 = :string2, map.#number3 = :string3
Related
I'm new to AWS DynamoDB and wanted to clarify something.
As I learned when we use query we should use the partition key which is unique among the list of items, then how the result from a query is a list!!! it should be one row!! and why do we even need adding more condition?
I think I am missing something here, can someone please help me to understand?
I need this because I want to query on list of applications with specific status value or for specific range of time but if I am supposed to provide the appId what is the point of the condition?
Thank you in advance.
Often your table will have sort key, which together with your partition key will create composite primary key. In this scenario a query can return multiple items. To return only one value, not a list, you can use get_item instead if you know unique value of the composite primary key.
curl -s 'localhost:26657/broadcast_tx_commit?tx="zid=1 title=xyz"'
Can something be done like this?
I want to store multiple data in a single transaction, so can it be done using key value pairs or any other technique that would work?
Yes, because it's up to you on how your application parses the transaction. If your application (sounds like a key-value database) can accept multiple key-value pairs separated by a space like in your example, then this'll work fine.
See the kvstore example. You could easily modify it to accept multiple key-value pairs.
Yes, here is the correct syntax to use it:
curl -s 'localhost:26657/broadcast_tx_commit?tx="zid=1"&tx="title=xyz"'
Since 'tx' itself is a key in order to input multiple key you need to add it as a transaction itself.
I am writing a scalding job.
Here's what I want to do: first groupBy a Key. That should give me a bunch of (Key, Iterator[Value]) pairs for each Key (correct me if I'm wrong here). Then for each Ley, I want to apply a function on its associated Iterator[Value].
How should I do this? I am currently using a groupBy followed by a mapGroup. I get an Iterator[Value] but that iterator only has one value for some reason. mapGroup is not getting to operate on multiple values. It's important that I get to see all the values for any given key at the same time. Any ideas?
Thanks!
How to add multiple node to relations here is my query
MATCH (n:Customer{name:"motoM"})-[:RECENT {default:TRUE}]-(l:Location{name:"Adugodi"}) return l how to write a query to add one more "location" node to the relation "recent" if location node is not found and setting default to true to newly created realtion
What about this?
MATCH (n:Customer{name:"motoM"})-[:RECENT {default:TRUE}]-(l:Location{name:"Adugodi"})
MERGE (n)-[:RECENT]->(l2:Location)
ON CREATE SET l2.default = true
RETURN l, l2
The direction needs to be specified so I made it up, but it might need to go the other way.
Well, I don't know if I understood what you were looking for, but this might help you :)
Try with this query:
MATCH (n:Customer{name:"motoM"})-[r:RECENT {default:TRUE}]-(:Location{name:"Adugodi"})
CREATE (l2:Location{name:"Wherever You need"})
With r,n,l,l2
Set r.default = false
With n,l2
CREATE (n)-[r2:RECENT{default:TRUE}]->(l2)
I'm using Withto make the query easier to read, but you can do it in a single query.
In fact, I think your problem is your Graph model.
You should probably do something like a Customer node, related to Location nodes with a "VISITED" relation, and when you create your VISITED relation, you set date property to timestamp. Then, when you get your relations, you can simply compare timestamps to get the closest one, and you know which one is the one your need. Also, if you need a default property, set it on the node, it'll be easier to match.
Tell me if you need a code example for match, create and set data with this graph model.
jpg
In that Picture i have colored one part. i have attribute called "deviceModel". It contains more than one value.. i want to take using query from my domain which ItemName() contains deviceModel attribute values more than one value.
Thanks,
Senthil Raja
There is no direct approach to get what you are asking.. You need to manipulate by writing your own piece of code. By running SELECT query you will get the item Attribute-value pair. So here you need to traverse each each itemName() and count values of your desire attribute.
I think what you are refering to is called MultiValued Attributes. When you put a value in the attribute - if you don't replace the existing attribute value the values will multiply, giving you an array of items connected to the value of that attribute name.
How you create them will depend on the sdk/language you are using for your REST calls, however look for the Replace=true/false when you set the attribute's value.
Here is the documentation page on retrieving them: http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/ (look under Using Amazon SimpleDB -> Using Select to Create Amazon SimpleDB Queries -> Queries on Attributes with Multiple Values)