Relationship data and foreign keys?
See original GitHub issueIs there any way I could include data from other tables when I only have the ID?
Example of what I’m expecting to achieve:
import { Reference } from "./types"
// Records should be added here to be indexed / made searchable
const references: Array<Reference> = [
{
collection: "comments",
index: "comments",
include: ["text", "user_id"],
},
]
export default references
Instead of indexing user_id
I would like it to get the actual user document based on the ID from users collection.
Is this possible?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
What is a database foreign Key? A beginner's tutorial
A foreign key is a column (or group of columns) used in a relational database to link data between tables. This tutorial will...
Read more >Relational Databases: Foreign Keys - MariaDB Knowledge Base
Relational Databases: Foreign Keys ... You already know that a relationship between two tables is created by assigning a common field to the...
Read more >Dimensional modeling: Primary and foreign keys - IBM
The primary key/foreign key relationships between tables in a star or snowflake schema, sometimes called many-to-one relationships, represent the paths along ...
Read more >Create and manage foreign key relationships | Cloud Spanner
This page describes how to manage foreign key relationships in your database. Foreign keys allow you to define relationships between tables.
Read more >What is a foreign key? (With SQL examples) - Cockroach Labs
Foreign keys put the “relational” in “relational database” – they help define the relationship between tables. They allow developers to ...
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 FreeTop 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
Top GitHub Comments
Ah, one more modification then! You’ll have to
await
the calls inFirestoreHandler.ts
So anywhere there is:
it should be changed to:
I think that oughtta do it
Sorry for the delay on this!
It seems like a better idea would be to use the
onItemUpserted
property in references and the add an update_by_query from elasticsearch. (You’ll have to pull the latest commit on the repo to have access to that)Something resembling (I’m not sure what your actual structure is):