<?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[Question about using unique indexes for Custom Entities]]></title><description><![CDATA[<p dir="auto">Hello BrainCloud Support Team,</p>
<p dir="auto">I would like to ask about using unique indexes with Custom Entities.</p>
<p dir="auto">We are currently using Custom Entity with the entityType FOLLOW, and we tried to create an index named test_index with the unique option enabled.</p>
<p dir="auto">However, the following error occurred:</p>
<pre><code>Error Code: 3010308
Error Message: Error adding custom entity index test_index for entityType FOLLOW
Exception: Index cannot be created with 'unique' option as prevents sharding of custom collection.
Exception message: Index cannot be created with 'unique' option as prevents sharding of custom collection.
</code></pre>
<p dir="auto">We would like to prevent duplicate values for a specific field in this Custom Entity.</p>
<p dir="auto">Could you please confirm whether Custom Entity indexes support the unique option?</p>
<p dir="auto">If unique indexes are not supported due to sharding, could you recommend the best alternative approach to enforce uniqueness for a field in Custom Entity?</p>
<p dir="auto">Thank you.</p>
<p dir="auto">Best regards,<br />
Gyutae Lee</p>
]]></description><link>https://forums.getbraincloud.com/topic/358/question-about-using-unique-indexes-for-custom-entities</link><generator>RSS for Node</generator><lastBuildDate>Fri, 29 May 2026 21:41:01 GMT</lastBuildDate><atom:link href="https://forums.getbraincloud.com/topic/358.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 May 2026 01:12:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Question about using unique indexes for Custom Entities on Fri, 29 May 2026 17:22:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://forums.getbraincloud.com/uid/571">@gyutaelee</a>,<br />
Currently, brainCloud blocks <code>unique</code> indexes on all custom collections as a blanket safeguard. The check happens unconditionally before the system even evaluates whether your collection is owned or sharded, so it rejects the <code>unique</code> option with that error.</p>
<p dir="auto">We can <strong>manually add the unique index</strong> for your <code>FOLLOW</code> collection on our end. Please send us a request with:</p>
<ol>
<li>Your <code>appId</code></li>
<li>The <code>entityType</code> (is it <code>FOLLOW</code> only?)</li>
<li>The field name(s) that need uniqueness</li>
<li>The desired index name (e.g., <code>test_index</code>)</li>
</ol>
<p dir="auto">Once we receive your request, we'll add the uniqueness constraint for you directly.</p>
]]></description><link>https://forums.getbraincloud.com/post/1283</link><guid isPermaLink="true">https://forums.getbraincloud.com/post/1283</guid><dc:creator><![CDATA[JasonL]]></dc:creator><pubDate>Fri, 29 May 2026 17:22:47 GMT</pubDate></item></channel></rss>