1

I would like to know if it is possible to create a unique constraint into an eve schema definition, between two or more fields of a document, instead of only one as shown on Eve's schema definition documentation,

I want the same behavior as creating a Unique Compound Index directly on mongodb, but on the eve API level.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
gcw
  • 1,639
  • 1
  • 18
  • 37

1 Answers1

2

That's currently not supported. However, Eve will respond with a 409 Conflict and a proper message in the response body if a duplicate key error is returned by Mongo, no matter wether the unique rule has been set at the API level.

Nicola Iarocci
  • 6,606
  • 1
  • 20
  • 33