不要怂,就是干,撸起袖子干!

Commit aefb8638 by Simon Schick Committed by Erik Seliger

docs(model): clarify documentation on projection aliasing (#10595)

Closes #10592
1 parent e07a7bea
Showing with 10 additions and 4 deletions
......@@ -25,7 +25,7 @@ Project.findOne({
attributes: ['id', ['name', 'title']]
}).then(project => {
// project will be the first entry of the Projects table with the title 'aProject' || null
// project.title will contain the name of the project
// project.get('title') will contain the name of the project
})
```
......
......@@ -379,15 +379,21 @@ export type OrderItem =
| [typeof Model, typeof Model, string, string];
export type Order = string | Fn | Col | Literal | OrderItem[];
/**
* Please note if this is used the aliased property will not be available on the model instance
* as a property but only via `instance.get('alias')`.
*/
export type ProjectionAlias = [string | Literal | Fn, string];
export type FindAttributeOptions =
| (string | [string | Literal | Fn, string])[]
| (string | ProjectionAlias)[]
| {
exclude: string[];
include?: (string | [string | Literal | Fn, string])[];
include?: (string | ProjectionAlias)[];
}
| {
exclude?: string[];
include: (string | [string | Literal | Fn, string])[];
include: (string | ProjectionAlias)[];
};
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!