From 405e951c9eec5a39e9f928e46c6b5108de2820b2 Mon Sep 17 00:00:00 2001 From: Carlos Gamez <118949383+CarlosGamez-Nova@users.noreply.github.com> Date: Sun, 4 Jun 2023 22:53:53 +0800 Subject: [PATCH] docs: removed duplicate Relationsihps > Getting Started > Loading Nested Relationship Removed a duplicate section showing how to retrieve nested relationships --- .../1.guide/3.relationships/1.getting-started.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/content/1.guide/3.relationships/1.getting-started.md b/docs/content/1.guide/3.relationships/1.getting-started.md index a359d1f65..b64763db6 100644 --- a/docs/content/1.guide/3.relationships/1.getting-started.md +++ b/docs/content/1.guide/3.relationships/1.getting-started.md @@ -239,16 +239,6 @@ useRepo(User).withAllRecursive().get() useRepo(User).withAllRecursive(2).get() ``` -### Loading Nested Relationships - -To load nested relationships, you may pass constraints to the 2nd argument. For example, let's load all of the book's authors and all of the author's personal contacts: - -```js -const books = useRepo(Book).with('author', (query) => { - query.with('contacts') -}).get() -``` - ## Inserting Relationships You may use `save` method to save a record with its nested relationships to the store. When saving new records into the store via `save` method, Pinia ORM automatically normalizes and stores data that contains any nested relationships in it's data structure. For example, let's say you have the `User` model that has a relationship to the `Post` model: