Alex Reyne
08/20/2020, 10:27 PMconst winnerSearch = await prisma.entries.findOne({
where: {
user: winner,
lotto_id: parseInt(x)
}
})
Gives me an errorAlex Reyne
08/20/2020, 10:30 PMArgument where of type EntriesWhereUniqueInput needs exactly one argument, but you provided user and lotto_id. Please choose one. Available args:
type EntriesWhereUniqueInput {
id?: Int
lotto_id?: Int
}
However I would only like to select the user with that specific lotto_idAlex Reyne
08/20/2020, 10:30 PMdefrex
08/20/2020, 11:30 PMRyan
08/21/2020, 6:20 AMfindOne
only works on unique items. For non-unique items, you would need to use findMany
.Petr Homoky
08/21/2020, 9:56 AMconst account = await prisma.account.findMany({where: {id: "sad", name: "sdaa"}).then(accounts=> accounts.length === 1 ? accounts[0] : undefined);
Alex Reyne
08/21/2020, 12:30 PM