Entity Repository

To get the entity repository:

let entityRepository = wetland.getManager().getRepository(Entity);

.find()

Finds entities based on provided criteria. Use null if you don't wish to pass any criteria. Optionals finding options can be used as a second argument.

entityRepository.find({name: 'Wesley'} , {populate: ['project']});

.findOne()

Finds a single entity. In this method, criteria can be either an object, a number, a string or null.

entityRepository.findOne({'u.name': 'Wesley', 'project.name': 'wetland'}, {alias: 'u', populate: ['u.project']});

.getQueryBuilder()

Gets a new query builder. Optionally you can create your alias by passing a string as an argument.

entityRepository.getQueryBuilder('u');

.getDerivedQueryBuilder()

Gets a new query builder which uses provided derived table. An optional second argument allows you to set the alias of the derived table.

entityRepository.getDerivedQueryBuilder(otherQueryBuilder, 'my_alias_derived');

Find options

Options Type
orderBy any
alias string
limit number
offset number
debug boolean
populate object, array of strings, array of objects

results matching ""

    No results matching ""