gcw
gcw

Reputation: 1621

Can I create unique-compound constraints on eve schema definition?

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.

Upvotes: 1

Views: 274

Answers (1)

Nicola Iarocci
Nicola Iarocci

Reputation: 6576

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.

Upvotes: 2

Related Questions