MCPcopy
hub / github.com/sequelize/sequelize / test

Function test

types/test/where.ts:209–224  ·  types/test/where.ts::test
()

Source from the content-addressed store, hash-verified

207class="cm">// From https://sequelize.org/master/en/v4/docs/models-usage/
208
209async function test() {
210 class="cm">// find multiple entries
211 let projects: MyModel[] = await MyModel.findAll();
212
213 class="cm">// search for specific attributes - hash usage
214 projects = await MyModel.findAll({ where: { name: class="st">'A MyModel', enabled: true } })
215
216 class="cm">// search within a specific range
217 projects = await MyModel.findAll({ where: { id: [1, 2, 3] } });
218
219 class="cm">// locks
220 projects = await MyModel.findAll({ lock: Transaction.LOCK.KEY_SHARE });
221
222 class="cm">// locks on model
223 projects = await MyModel.findAll({ lock: { level: Transaction.LOCK.KEY_SHARE, of: MyModel} });
224}
225
226MyModel.findAll({
227 where: {

Callers

nothing calls this directly

Calls 1

findAllMethod · 0.80

Tested by

no test coverage detected