API Platform mongo document index annotation doesnt work

why the index creation (properthy testId) doesnt work? I’ve tried it via annotation. Can somebody help in this case?

    /**
 * @ODMField(type="string")
 * @ODMIndex(unique=true, order="asc")
 * @AssertNotBlank
 * @AssertType(
 *     type="string",
 *     message="The value {{ value }} is not a valid {{ type }}."
 * )
 */
public $testId;

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *