209 похожих чатов

Ребят, кто в typeOrm шарит? Помогите пожалуйста: хочу получить все

беседы пользователя с пользователями в каждой. Делаю это так, но возвращаются беседы с полем users, где только текущий польщователь, а мне нужно чтобы там были все. Что я делаю не так?
await this.conversationRepository
.createQueryBuilder('conversation')
.leftJoinAndSelect('conversation.users', 'user')
.where('user.id = :userId', { userId })
.getMany();
Сущность пользователя и беседы приложил скринами

4 ответов

3 просмотра
Anton-Mazhuto Автор вопроса
Anton Mazhuto
screenshot

Два раза заджойнить юзеров, в первом случае использовать для where, во втором заселектить

Anton-Mazhuto Автор вопроса
Max Kiner
Два раза заджойнить юзеров, в первом случае исполь...

Максим, а если не сложно можете набросать как это будет ? Не совсем понимаю как два раза заджойнить

Anton Mazhuto
Максим, а если не сложно можете набросать как это ...

.leftJoin('conversation.users', 'u') .leftJoinAndSelect('conversation.users', 'users') .where('u.id = :id', { id }) Типа того

Похожие вопросы

Обсуждают сегодня

Is UniBright Freequity an active live product ? A friend here in Asia was discussing the Tokenisation of RWA’s in his case Real Estate as he’s a developer with numerous overs...
Digital Trust
4
Hi, I am a bit confused... I just unbonded on app.persistence.one stkSTARS/STARS with a liquidity of $127. From a time period of 60 days and a reward percentage of 9.72% at t...
Matias
6
Crypto aman premium grp koi join kiya hai... Kaisa hai service any one idea??
Arvind Sharma
16
@everyone Hello Future! We are extremely excited to announce the hottest season ever: DeFi Summer 2024 🔥 Introducing the Stake and Burn Model: You Stake yours, we Burn...
Dennis The Menace
1
When ethereum was new and not accepted as currency anywhere someone made a viral app that famously clogged ethereum- crypto kitties. I deplore aping other projects and I’m n...
🗿len
2
Agreed! What's the next big thing for FUNToken? Any hints? 🤔
Dennis Read
23
Had my LGCY in a CEX and transferred it to a pvt wallet in Dec 2021. Haven't touched it since. So, I just have to wait for the team to release the swap contract to swap to LG...
💎 Hands
23
KDSwap, a decentralized exchange (DEX) built on Kadena, is setting a new standard by working towards becoming a MiCA-compliant DEX in Europe. What sets KDSwap apart? While ...
Mal (will not DM you first) Sutton
20
So I’ve missed their deadline?
Shane Oconnor
12
Hello everyone, somehow I ended up with ~640k coins of NPXS… How could I go about converting that to any other crypto/USDC? Coinbase wallet keeps giving me a 98% price impact...
Endless Drifter
6
Карта сайта