• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Question about using unique indexes for Custom Entities

Scheduled Pinned Locked Moved Unsolved General
2 Posts 2 Posters 9 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by gyutaelee
    #1

    Hello BrainCloud Support Team,

    I would like to ask about using unique indexes with Custom Entities.

    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.

    However, the following error occurred:

    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.
    

    We would like to prevent duplicate values for a specific field in this Custom Entity.

    Could you please confirm whether Custom Entity indexes support the unique option?

    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?

    Thank you.

    Best regards,
    Gyutae Lee

    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote last edited by
    #2

    Hi @gyutaelee,
    Currently, brainCloud blocks unique 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 unique option with that error.

    We can manually add the unique index for your FOLLOW collection on our end. Please send us a request with:

    1. Your appId
    2. The entityType (is it FOLLOW only?)
    3. The field name(s) that need uniqueness
    4. The desired index name (e.g., test_index)

    Once we receive your request, we'll add the uniqueness constraint for you directly.

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users