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

Всем привет еще раз. Есть юзер, и у него

есть посты. Как в этих постах хранить id юзера?

Typeorm Mongodb Nest

8 ответов

14 просмотров

Так и хранить userId в документе, ну или createdBy

Элёр-Шодиёров Автор вопроса
Konstantin Belkin
Так и хранить userId в документе, ну или createdBy

А как именно указать ссылку? Column (type=> User) userId: ObjectId Сделал так, но не работает, если получить посты то нет этот userId. Когда то делал на экспресс монгоосе так userId: {type: ObjectId, ref:'user'}

Элёр Шодиёров
А как именно указать ссылку? Column (type=> User...

А сейчас без монгуса? Я вообще специфически отношусь к связям в nosql)

Элёр Шодиёров
Да сейчас TypeOrm

Ну честно говоря не знаю как сейчас но typeorm не очень с монго) ну если там с монгой одинаково работает как с другими бд то смотрите one-to-many/many-to-one

Элёр-Шодиёров Автор вопроса
Konstantin Belkin
Ну честно говоря не знаю как сейчас но typeorm не ...

Я их пробовал, нет такого, сразу же падает ошибка

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

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

@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGCY | BattleVerse L1 | BitWin
1
Did @Beeker really get banned? That's ridiculous. He's one of the few left here with half a brain and you might not always like his narrative @dgb_ycagel , but he often keeps ...
Leroy Gerrits
1
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
We heading to 1.1$ 🤔?
CryptoBo$$
35
Hello guys, I have staked Matic as stMatic via Lido nearly a year ago and recently I wanted to unstake but the platform offered me to unstake via Kyberswap for a faster trans...
Mike
7
I mean how is Arrr used to buy stuff ? Or does it just sit in your wallet ?
Steve
9
Agreed. And on a lighter note, I just love the idea of earning $FunToken while having fun. It’s like getting paid to do what we love. Who wouldn’t want that? 😄
SpaceGemz
13
Does anyone need blockchain/AI developer?
golden
7
how/why would someone end up holding FBCH, that's the nut to crack would some bch holders be interested in donating BCH as incentive for others to lock up BCH if I offered 1...
bitcoincashautist
4
Ideally, when we launch a game from a particular studio, that studio should have the right to access the uniqs from their game on our wallet. For example, if you die in a Ubis...
Lisandru
16
Карта сайта