Menu

Annotations JSON Support

Introducing JSON support for annotations. This allows annotating objects with JSON configuration without need to convert it to PHP array syntax. Additionally new syntax can be mixed with old one. Adding support for JSON is backwards compatible, as in previous version such syntax would throw exception.

The idea came from the MongoDB documentation, where document indexes are defined with JSON. So that syntax known by MongoDB users could be used in Mangan.

Example of annotation with JSON syntax

@Index({score: 1})

Notice the unquoted key. It is possible to use unquoted values, but risky to some extend.