Skip to content

Commit

Permalink
a bit of additional doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierrci committed May 21, 2024
1 parent 113a74e commit 25492ac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ export interface DatabaseJSON {
}

export type Reference = {
/** The external collection this references links to */
collection: string;
/** The key in the external collection, useful to generate a query based on it */
key: string;
}

export type CollectionRefs = { [ prop: string ]: Reference[]; }
/**
* List of keys in the collection documents that are associated with documents in other collections
* The collection a key refers to can vary from one document to another, hence the array
*/
export type CollectionRefs = { [prop: string]: Reference[]; }

export type DbRefs = {
[ collection: string ]: CollectionRefs;
[collection: string]: CollectionRefs;
}

export class Database {
Expand Down

0 comments on commit 25492ac

Please sign in to comment.