Open hacke2 opened 8 years ago
I had use hasOne get Pet,e.g:
Animal.hasOne('owner', Person, {reverse: 'pets'}) Person(1).getPets(function(err, pets) { console.log(pets); });
I want through one sql query Animal's fields, can I ?
like this sql:
SELECT person.name, animal.name FROM Person as person, Animal as animal WHERE animal.owner_id = person.id
How many queries does the above generate?
I had use hasOne get Pet,e.g:
I want through one sql query Animal's fields, can I ?
like this sql: