-1
I would like to turn this code into Mysql
SELECT pets.nome, pets.pulseira AS pets , localizacao.datahora,
localizacao.latitude, localizacao.longitude AS localizacao FROM pets
JOIN localizacao ON
localizacao.localPetID = id_pet where pets.id_pet = 1
in a sequelize syntax.
So far all I’ve got is this:
pet.Pet.findAll({
//selecionando os atributos nome e pulseira
attributes: [
'nome',
'pulseira'
],
//informando quais os valores para busca
where: {
nome: nomePet,
pulseira: pulseira
}
}).then((pet) => {
res.render('index', { pet: pet })
})
they are returning me only the name and number of the bracelet, however, I need it to come together the data of datahora
, latitude
and longitude
to display.