What are Entities in Medusa js

Опубликовано: 09 Март 2024
на канале: ZeeCoding
223
4

@zeecoding
#coding #zeecoding #learncoding #codingforbeginners
Entities in medusa represent tables in the database as classes. An example of this would be the Order entity which represents the order table in the database. Entities provide a uniform way of defining and interacting with data retrieved from the database.

Aside from the entities in the Medusa core package, you can also create custom entities to use in your Medusa backend. Custom entities are TypeScript or JavaScript files located in the src/models directory of your Medusa backend. You then transpile these entities to be used during the backend's runtime using the build command, which moves them to the dist/models directory.

Entities are based on Typeorm’s Entities and use Typeorm decorators. Each entity also require a repository to be created. A repository provides basic methods to access and manipulate the entity's data.


Смотрите видео What are Entities in Medusa js онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь ZeeCoding 09 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 223 раз и оно понравилось 4 людям.