<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to rename xid in Jsondata]]></title><description><![CDATA[<p dir="auto">I had copied the following script from API Docs&gt;Directives&gt;ma-json-store and tried it.</p>
<p dir="auto">&lt;ma-json-store xid="phoneData" item="myItem" value="myValue"&gt;&lt;/ma-json-store&gt;<br />
&lt;input ng-model="myValue.phone"&gt;<br />
&lt;md-button class="md-raised md-primary md-hue-3" ng-click="myItem.$save()"&gt;<br />
&lt;md-icon&gt;save&lt;/md-icon&gt; Save<br />
&lt;/md-button&gt;<br />
&lt;p&gt;Phone # from JSON store: {{myItem.jsonData.phone}}&lt;/p&gt;</p>
<p dir="auto">I realized that each time I rename XID to a different name, a different ID is created in jsondata. I detected this when I used SQL to query out the data from Jsondata using this script "select * from  jsondata".</p>
<p dir="auto">Question:</p>
<ol>
<li>How to I rename XID to a different name without deleting ID?</li>
</ol>
<p dir="auto">For example, Jsondata may give an ID of 36 with XID "Name". I want to change the ID 36 XID from "Name" to "Address" without deleting ID 36.</p>
<p dir="auto">Current:<br />
ID   XID<br />
36  Name</p>
<p dir="auto">Change to:<br />
ID   XID<br />
36  Address</p>
<ol start="2">
<li>For the above script, is it possible to ID instead XID? Does the following script work? I had tried but failed. Perhaps I had missed out something.</li>
</ol>
<p dir="auto">&lt;ma-json-store id="36" item="myItem" value="myValue"&gt;&lt;/ma-json-store&gt;<br />
&lt;input ng-model="myValue.phone"&gt;<br />
&lt;md-button class="md-raised md-primary md-hue-3" ng-click="myItem.$save()"&gt;<br />
&lt;md-icon&gt;save&lt;/md-icon&gt; Save<br />
&lt;/md-button&gt;<br />
&lt;p&gt;Phone # from JSON store: {{myItem.jsonData.phone}}&lt;/p&gt;</p>
<ol start="3">
<li>For ID, is it possible to assign the number manually instead of letting system to generate ID? If yes, how can I do it?</li>
</ol>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.mango-os.com/topic/2648/how-to-rename-xid-in-jsondata</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 17:25:11 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2648.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Feb 2017 08:32:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to rename xid in Jsondata on Fri, 03 Feb 2017 18:18:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi Felicia,</p>
<p dir="auto">I'm still not sure I understand. Why couldn't you use the XID field in the manner you are describing?</p>
]]></description><link>https://forum.mango-os.com/post/13793</link><guid isPermaLink="true">https://forum.mango-os.com/post/13793</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 03 Feb 2017 18:18:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to rename xid in Jsondata on Thu, 02 Feb 2017 06:37:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi Phildunlap,</p>
<p dir="auto">Thanks for the prompt reply.</p>
<p dir="auto">Basically, I will be using XID to do some naming which may be very lengthy. Therefore, I am thinking using ID instead since it is just numeric &amp; short. Just want to see if it is possible.</p>
<p dir="auto">Regards,<br />
Felicia</p>
]]></description><link>https://forum.mango-os.com/post/13781</link><guid isPermaLink="true">https://forum.mango-os.com/post/13781</guid><dc:creator><![CDATA[Felicia Luong]]></dc:creator><pubDate>Thu, 02 Feb 2017 06:37:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to rename xid in Jsondata on Wed, 01 Feb 2017 20:46:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi Felicia,</p>
<ol>
<li>Can you explain some of why you are wanting to work with the IDs directly? Certainly one can change the ID through the SQL console, running</li>
</ol>
<pre><code>UPDATE jsonData SET xid='Address' WHERE id=36;
</code></pre>
<ol start="2">
<li>
<p dir="auto">No it is not possible currently.</p>
</li>
<li>
<p dir="auto">The ID is a normal autoincrement column and primary key. So, while it is possible to assign any unique integer, the database server prefers that you do not, since it is tracking what the next ID is in the information schema tables, and it simplifies the database's job to let it manage the uniqueness of the keys without having to query anything. I am not sure offhand if manually setting the ID to the value of the next ID in the information schema for the table will throw an error or not, but I cannot think of a good reason to do this. If you are trying to encode information into the number, why wouldn't you be encoding that information into the XID instead and working with the XIDs?</p>
</li>
</ol>
]]></description><link>https://forum.mango-os.com/post/13775</link><guid isPermaLink="true">https://forum.mango-os.com/post/13775</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 01 Feb 2017 20:46:43 GMT</pubDate></item></channel></rss>