NocoDB
Join tables with foreign keys automatiically [Apr 23]
Discord-Discussions
NocoDB
November 3, 2022, 9:01am
1
BoMBx
asked
Hi, I have a question. Does nocodb join tables which have foreign keys automatically ? If yes, can I set if don’t want it to join automatically?
NocoDB
November 3, 2022, 9:01am
2
wkw
replied
Yes and No. Columns with LinkToAnotherRecord type will be created.
NocoDB
November 3, 2022, 9:01am
3
wkw
replied
Discussed with user in DM. Here’s the summary.
Question 1: Want to query a table in REST API call but excluding some fields
Ans: Using fields to determine which fields to show.
Example:
/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}?fields= field_name,field_name2
Question 2: Query a table joining another table with some identical column names. Would it be any conflicts.
Answer:
In the returned json, the LinkToAnotherRecord data is presented in a nested way. For example, table A and table B both have a ManyToMany column.
In GUI, you will see TableBMMList in TableA and TableAMMList in Table B
if you call the api, you should see
{
field1: ‘xxx’,
field2: ‘xxx’,
TableAMMList: [{…}, {…}, {…}],
created_by: ‘xxx’
}
Similarly, for HasMany column, it will be TableARead
{
field1: ‘xxx’,
field2: ‘xxx’,
TableARead: {…},
created_by: ‘xxx’
}
so one can identify TableARead.field1 and field1
NocoDB
November 3, 2022, 9:01am
4
Autogenerated from discord
Join
NocoDB’s
community
Discord
•
Twitter
•
Reddit
•
Docs
Related topics
Topic
Replies
Views
Activity
ForeignKey is reverse LinkToAnotheRecord [Aug 30]
Discord-Discussions
9
254
November 3, 2022
API to insert nested fields (many to many) [May 20]
Discord-Discussions
5
374
November 3, 2022
Lookup Table Question
5
703
February 28, 2023
Omission of joining tables
External Data Source
1
47
July 17, 2024
Automatic ID [Jun 16]
Discord-Discussions
9
225
November 3, 2022