Sasha
1c99f46e4f
feat: queriable / sortable / useAsTitle virtual fields linked with a relationship field ( #11805 )
...
This PR adds an ability to specify a virtual field in this way
```js
{
slug: 'posts',
fields: [
{
name: 'title',
type: 'text',
required: true,
},
],
},
{
slug: 'virtual-relations',
fields: [
{
name: 'postTitle',
type: 'text',
virtual: 'post.title',
},
{
name: 'post',
type: 'relationship',
relationTo: 'posts',
},
],
},
```
Then, every time you query `virtual-relations`, `postTitle` will be
automatically populated (even if using `depth: 0`) on the db level. This
field also, unlike `virtual: true` is available for querying / sorting /
`useAsTitle`.
Also, the field can be deeply nested to 2 or more relationships, for
example:
```
{
name: 'postCategoryTitle',
type: 'text',
virtual: 'post.category.title',
},
```
Where the current collection has `post` - a relationship to `posts`, the
collection `posts` has `category` that's a relationship to `categories`
and finally `categories` has `title`.
2025-04-16 15:46:18 -04:00
..
2025-04-03 15:17:23 +00:00
2025-04-10 20:47:26 -03:00
2025-04-10 17:37:10 +00:00
2025-04-08 17:25:29 -03:00
2025-03-31 13:11:34 -04:00
2024-11-16 15:30:05 -05:00
2025-04-08 17:25:29 -03:00
2025-04-04 20:52:10 +03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-03-21 14:44:49 -04:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2024-09-20 22:46:40 -04:00
2025-04-08 17:25:29 -03:00
2025-04-16 15:46:18 -04:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-15 15:23:51 -04:00
2025-04-08 17:25:29 -03:00
2025-04-16 15:38:53 -04:00
2025-04-15 15:23:51 -04:00
2025-04-15 15:23:51 -04:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 20:56:24 -06:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2024-10-30 17:56:50 +00:00
2025-04-10 15:30:40 -04:00
2025-04-10 20:47:26 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2024-08-13 12:54:33 -04:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-16 09:16:43 -04:00
2025-04-03 12:27:14 -04:00
2025-04-03 09:07:10 -04:00
2024-07-23 13:44:44 -04:00
2025-04-08 17:25:29 -03:00
2025-04-14 09:47:08 +01:00
2025-04-15 12:09:55 -04:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-08 17:25:29 -03:00
2025-04-10 13:18:10 +01:00
2025-04-11 10:43:40 -04:00
2024-07-11 15:59:38 -04:00
2024-05-25 15:45:05 +00:00
2025-01-24 01:58:45 +00:00
2025-04-11 19:24:24 +00:00
2024-12-31 09:14:56 -05:00
2025-04-01 09:54:22 -04:00
2024-12-20 20:13:28 +00:00
2024-12-19 11:08:17 -05:00
2024-08-13 12:54:33 -04:00
2025-03-05 19:14:35 +00:00
2024-09-16 17:02:08 +00:00
2025-03-24 13:16:39 -04:00
2024-09-16 17:02:08 +00:00
2024-11-11 13:59:05 -05:00
2024-10-11 18:54:39 +00:00
2025-02-17 19:50:32 +00:00
2024-10-11 18:54:39 +00:00
2024-12-17 14:49:29 -05:00
2025-03-11 09:45:13 -06:00
2025-04-09 21:42:45 +00:00
2024-05-01 17:35:41 -04:00
2025-02-07 03:24:49 +00:00
2025-02-17 19:50:32 +00:00
2024-08-14 08:57:04 -04:00
2024-08-14 08:57:04 -04:00
2024-10-14 20:02:26 +00:00
2025-03-05 19:14:35 +00:00
2024-04-06 15:06:04 -04:00
2024-06-17 14:25:36 -04:00
2025-02-14 00:08:20 +00:00
2025-01-14 20:00:00 -03:00
2025-03-05 19:14:35 +00:00