This content has been marked as final. Show 6 replies
Each key has exactly one value. By key-value store it is meant that the store is treated like a Map data structure (java.util.Map, for example, if you are a Java programmer).
I don't understand why you say each key has exactly one value.
Suppose we have a key username.
We can have pairs <username/john> and <username/Jeff>
So for the same key, we have two values.
Thanks for you inputs.
I think you mean that you have two keys, /username/john and /username/Jeff. A key may have multiple components -- 'username' and 'john' are the two components of the first key. Each of the two keys also has a value, which is the data stored for that key.
Are you a programmer, and have you used a Map data structure?
I suggest that you look in detail at the example program in the examples/schema directory to see how keys and values are used.
For me username was the key and John or Jeff the values.
When I look for the key username, I expect to have a name as value.
So, for me it is the key which help me to know what type of value is stored there.
Am I wrong? I am not used with java for the moment.
You are using the term "value" incorrectly, and this makes it very difficult to communicate. Please read the NoSQL DB documentation for how this term is used with this product.
You will need to know Java fairly well before using the NoSQL DB product. You will not be able to understand the API without knowing Java, because the API is currently only available and documented in Java.
When I look for the key username, I expect to have a name as value.So, for me it is the key which help me to know what type of value is stored there.
Am I wrong?>
I think you are right, but you are using the wrong terminology. Here is the correct terminology: In general a key is a major path and a minor path, where each path is a list of strings. In your case, I believe you're only using the major path. Your major path has two components (two strings). The first component (the constant 'username') tells you what to expect in the second component ('John' or 'Jeff').
You can think of the second component of your key path as a variable rather than a constant component. But please don't call it a value, since the term value is reserved for something else -- it is the data associated with the key in the key-value pair. After all, this is a key-value store, so key and value are pretty important terms.