How would I just grab one row from a relationship?...
# orm-help
r
How would I just grab one row from a relationship? Using
take: 1
still get all rows related to that relationship.
export const users = () => {
  
return db.user.findMany({
    
select: {
      
id: true,
      
name: true,
      
userActivity: {
        
take: 1,
        
select: {
          
type: true,
          
createdAt: true,
        
},
      
},
    
},
  
})
}