Version: 4.3
Usage with JavaScript
Since MikroORM 3.2, we can use EntitySchema
helper to define own entities without
decorators, which works also for Vanilla JavaScript.
Read more about
EntitySchema
in this section.
Here is an example of such entity:
./entities/Author.js
Do not forget to provide
name
andpath
schema parameters as well asentity
andschema
exports.
Reference parameter can be one of (where SCALAR
is the default one):
You can register your entities as usual.
For more examples of plain JavaScript entity definitions take a look Express JavaScript example.