Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Latest commit

 

History

History
16 lines (12 loc) · 549 Bytes

working-with-entity-manager.md

File metadata and controls

16 lines (12 loc) · 549 Bytes

What is EntityManager

Using EntityManager you can manage (insert, update, delete, load, etc.) any entity. EntityManager is just like a collection of all entity repositories in a single place.

You can access the entity manager via getManager() or from Connection. Example how to use it:

import {getManager} from "typeorm";

const entityManager = getManager(); // you can also get it via getConnection().manager
const user = await entityManager.findOneById(User, 1);
user.name = "Umed";
await entityManager.save(user);