Skip to content

Can I use compound unique index in parse?  #2790

Closed

Description

@jimmyzzzzzzz

According to https://www.parse.com/questions/unique-fields--2 I thought unique key was not possible. Now I'm hosting Parse with Mongodb on my own server and I can easily create compound unique indexes in mongodb. Can I safely enable this feature in my production database?

Activity

  1. steven-supersolid commented on Sep 27, 2016

    @steven-supersolid
    Contributor

    The parse question/answer is from a while ago and refers to setting a unique index via code, which is still not possible.

    You can of course set unique indexes at the database level which will cause an error when updating but that should be safely caught by parse-server and returned as a parse error.

    I do this in production and parse-server enforces some unique indexes on _User so it seems safe enough, but my advice is to try this in dev first for your specific use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions