| 207 | class="cm">// From https://sequelize.org/master/en/v4/docs/models-usage/ |
| 208 | |
| 209 | async 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 | |
| 226 | MyModel.findAll({ |
| 227 | where: { |