How to use the IsNull function from typeorm

Find comprehensive JavaScript typeorm.IsNull code examples handpicked from public code repositorys.

84
85
86
87
88
89
90
91
92
93
});

it('expecting 2 participants to have bet of 100', async () => {
  const raffle = await AppDataSource.getRepository(Raffle).findOne({
    relations: ['participants'],
    where:     { winner: IsNull(), isClosed: false },
  });
  assert.strictEqual(raffle.participants.length, 2);
  assert.strictEqual(raffle.participants[0].tickets, 100);
  assert.strictEqual(raffle.participants[1].tickets, 100);
fork icon71
star icon267
watch icon11

48
49
50
51
52
53
54
55
56
57
});

it('expecting 2 participants to have bet of 100 and 50', async () => {
  const raffle = await AppDataSource.getRepository(Raffle).findOne({
    relations: ['participants'],
    where: { winner: IsNull(), isClosed: false },
  });
  assert.strictEqual(raffle.participants.length, 2);
  try {
    assert.strictEqual(raffle.participants[0].tickets, 100);
fork icon72
star icon261
watch icon0

45
46
47
48
49
50
51
52
53
54
}
else {
    users = await User_1.User.findByIds(input.invitations, {
        id: typeorm_1.Not(user.id),
        countryId: user.country.id,
        teamId: typeorm_1.IsNull(),
    });
}
if (!validator_1.default.isLength(name, {
    min: 1,
fork icon1
star icon0
watch icon0

681
682
683
684
685
686
687
688
689
690
case 0:
    itemsRetiradosValidos = [];
    return [4 /*yield*/, itemsRetiradosRepo_1.find({
            where: {
                event: { id: item },
                refund: typeorm_1.IsNull(),
                retirado: typeorm_1.Not(typeorm_1.IsNull())
            },
        })];
case 1:
fork icon0
star icon0
watch icon0

120
121
122
123
124
125
126
127
128
129
let repository = typeorm_1.getRepository(Coupons_1.Coupons);
try {
    // Find a cupon that hasn't already been assigned
    let couponToUpdate = await repository.findOne({
        where: {
            customer_email: typeorm_1.IsNull(),
        },
    });
    // If there is a coupon, update it. Otherwise, send a message.
    if (couponToUpdate) {
fork icon0
star icon0
watch icon0