MongoDB relations support ?
See original GitHub issueIssue type:
[x ] question [ ] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[x ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x ] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Hi there, I’d like to know if typeorm support mongodb relations. If so, how to define this relation in entities.
I want to do a query like this:
let candidatures = await candidatRepository.find({
join: {
alias: "c",
leftJoinAndSelect: {
m: "c.membre"
}
},
});
But json objects returned does not contain “membre” entities.
Membre:
import {Entity, Column, ObjectIdColumn} from "typeorm";
import {ObjectID} from "mongodb";
import {Membre} from "./Membre";
@Entity("candidats")
export class Candidat
{
@ObjectIdColumn()
id: ObjectID;
...
//@ObjectIdColumn()
@Column(type => Membre)
membre: Membre;
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Model Relationships Between Documents — MongoDB Manual
Presents a data model that uses embedded documents to describe one-to-many relationships between connected data. Model One-to-Many Relationships with Document ...
Read more >MongoDB - Relationships - Tutorialspoint
Relationships in MongoDB represent how various documents are logically related to each other. Relationships can be modeled via Embedded and Referenced ...
Read more >Is it possible to have relation between object in a MongoDB ...
MongoDB (and most other NoSQL databases) do not natively support the concept of relations. RDBMSs have native query tools to define and make ......
Read more >MongoDB Relationships: A Quick Guide - KnowledgeHut
How to best use data relationships in MongoDB? ... With the help of an example, we will now discuss the one-to-many relationship with ......
Read more >MongoDB Relationships (Embedded & Reference) - DataFlair
One to One Relationship in MongoDB. It is where the parent document has one child, and the child has one parent. With the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@the-nicolas didn’t invest in solving this, I have started creating my own framework.
I’m looking to get an integration of this merged: https://www.npmjs.com/package/@kaviar/nova