<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged keys-array</title>
<link>https://www.multichain.com/qa/tag/keys-array</link>
<description>Powered by Question2Answer</description>
<item>
<title>What is the syntax for an array of keys when using liststreamkeys (multichain 1.0.4)?</title>
<link>https://www.multichain.com/qa/10418/what-syntax-array-keys-when-using-liststreamkeys-multichain</link>
<description>&lt;p&gt;&lt;span style=&quot;color:rgb(199, 37, 78); font-family:menlo,monaco,consolas,courier new,monospace; font-size:12.600000381469727px&quot;&gt;liststreamkeys&amp;nbsp;&lt;/span&gt;allows the user&amp;nbsp;to &quot;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif; font-size:14px&quot;&gt;Pass a single key in&amp;nbsp;&lt;/span&gt;keys&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif; font-size:14px&quot;&gt;&amp;nbsp;to retrieve information about one key only, pass an array for multiple keys, or&amp;nbsp;&lt;/span&gt;*&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif; font-size:14px&quot;&gt;&amp;nbsp;for all keys&lt;/span&gt;&quot;.&lt;/p&gt;&lt;p&gt;JSON syntax for an array is something like&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;{&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;,&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;age&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:red; font-family:consolas,courier new; font-size:16px&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;,&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;cars&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;:[&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;Ford&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;BMW&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:brown; font-family:consolas,courier new; font-size:16px&quot;&gt;&quot;Fiat&quot;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 0); font-family:consolas,courier new; font-size:16px&quot;&gt;&amp;nbsp;]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:rgb(165, 42, 42); font-family:consolas,courier new; font-size:16px&quot;&gt;}&lt;/span&gt;&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But when I've tried to pass in an array of keys to search with &lt;span style=&quot;color:rgb(199, 37, 78); font-family:menlo,monaco,consolas,courier new,monospace; font-size:12.600000381469727px&quot;&gt;liststreamkeys&lt;/span&gt;, it thinks that I'm passing in the whole thing (curly brackets and all) as the key.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;testChain: liststreamkeys teststream {&quot;key&quot;:&quot;1522317920788t1t63342t3t6tFILE_ACCESStMOD_FlyBase&quot;,&quot;key&quot;:&quot;1522000002801t1t1t1t1tREQ_RESOURCEtMOD_UCSC_Genome_Bioinformatics&quot;}&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Here's the output:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; {&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;key&quot; : &quot;{key:1522317920788t1t63342t3t6tFILE_ACCESStMOD_FlyBase,key:1522000002801t1t1t1t1tREQ_RESOURCEtMOD_UCSC_Genome_Bioinformatics}&quot;,&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;items&quot; : 0,&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;confirmed&quot; : 0&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; }&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I've also tried&amp;nbsp;&lt;/p&gt;&lt;p&gt;testChain: liststreamkeys teststream&amp;nbsp;[&quot;1522317920788t1t63342t3t6tFILE_ACCESStMOD_FlyBase&quot;,&quot;1522000002801t1t1t1t1tREQ_RESOURCEtMOD_UCSC_Genome_Bioinformatics&quot;]&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/10418/what-syntax-array-keys-when-using-liststreamkeys-multichain</guid>
<pubDate>Fri, 27 Jul 2018 16:09:52 +0000</pubDate>
</item>
<item>
<title>Why are &quot;keys&quot; and &quot;publishers&quot; properties arrays</title>
<link>https://www.multichain.com/qa/9643/why-are-keys-and-publishers-properties-arrays</link>
<description>&lt;p&gt;When I call&amp;nbsp;&lt;strong&gt;liststreamitems&lt;/strong&gt;&amp;nbsp;it returns a list of objects like this:&lt;/p&gt;&lt;pre&gt;       {
            &quot;publishers&quot;: [
                &quot;13hhTLheZXjFj5owddcBNMu2jnNPxvbUZrrnHx&quot;
            ],
            &quot;keys&quot;: [
                &quot;ASDF&quot;
            ],
            &quot;data&quot;: &quot;7b2274656d70223a31322c2268756d223a36357d&quot;,
            &quot;confirmations&quot;: 25,
            &quot;blocktime&quot;: 1526372965,
            &quot;txid&quot;: &quot;6c2e0eeee735233241081000bf06895482e1329eede1ac62d22ce4f11e38bec9&quot;
        }&lt;/pre&gt;&lt;pre&gt;
&amp;nbsp;&lt;/pre&gt;&lt;p&gt;The&amp;nbsp;&lt;strong&gt;keys&lt;/strong&gt;&amp;nbsp;property is an array, but I don't understand why, since I published this data to this particular key. Then I published more values to the same key, and to other keys and the&amp;nbsp;&lt;strong&gt;keys&lt;/strong&gt;&amp;nbsp;property will never accumulate inside an array. Every published item is returned as separate object with only 1 value in the&amp;nbsp;&lt;strong&gt;keys&lt;/strong&gt;&amp;nbsp;array.&lt;br&gt;Same goes for&amp;nbsp;&lt;strong&gt;publishers&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;What is the purpose behind them being an array?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/9643/why-are-keys-and-publishers-properties-arrays</guid>
<pubDate>Tue, 15 May 2018 08:43:48 +0000</pubDate>
</item>
<item>
<title>Tell me one simple usecase  for storing mutiple keys with json data</title>
<link>https://www.multichain.com/qa/8346/tell-simple-usecase-for-storing-mutiple-keys-with-json-data</link>
<description>Hello Multichain team, I know this stream feature has come as enhancement on multichain 1.x version . &amp;nbsp;what I &amp;nbsp;am not able to understand &amp;nbsp;is how to use multiple keys against json data ? can you please give a simple usecase where it helps .</description>
<guid isPermaLink="true">https://www.multichain.com/qa/8346/tell-simple-usecase-for-storing-mutiple-keys-with-json-data</guid>
<pubDate>Thu, 25 Jan 2018 08:43:11 +0000</pubDate>
</item>
<item>
<title>MultiChain2.0 alfa issues on stream keys array and data-json</title>
<link>https://www.multichain.com/qa/7799/multichain2-0-alfa-issues-on-stream-keys-array-and-data-json</link>
<description>Cheching 2.0 alfa 1 release and try to write several keys with data-json structure instead a key and data-hex.&lt;br /&gt;
&lt;br /&gt;
CLI help notifies this^&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
1. &amp;quot;from-address&amp;quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string, required) Address used for issuing.&lt;br /&gt;
2. &amp;quot;stream-identifier&amp;quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string, required) Stream identifier - one of the following: stream txid, stream reference, stream name.&lt;br /&gt;
3. &amp;quot;key&amp;quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string, required) Item key&lt;br /&gt;
&amp;nbsp;or&lt;br /&gt;
3. keys &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(array, required) Array of item keys&lt;br /&gt;
4. &amp;quot;data-hex&amp;quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string, required) Data hex string&lt;br /&gt;
&amp;nbsp;or&lt;br /&gt;
4. data-json &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(object, required) JSON data object&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;json&amp;quot; : data-json &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(object, required) Valid JSON object&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;or&lt;br /&gt;
4. data-text &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(object, required) Text data object&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;text&amp;quot; : &amp;quot;data-text&amp;quot; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string, required) Data string&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
However any keys arrays variants came back as string and no way to send any data-json or data-text.&lt;br /&gt;
&lt;br /&gt;
Please check this options work and send your variant of example.</description>
<guid isPermaLink="true">https://www.multichain.com/qa/7799/multichain2-0-alfa-issues-on-stream-keys-array-and-data-json</guid>
<pubDate>Fri, 08 Dec 2017 10:09:19 +0000</pubDate>
</item>
</channel>
</rss>