const query = new AV.Query('Post'); query.include('author'); query.find() .then(posts => { // This will also fetch the author object for each post const authors = posts.map(post => post.get('author')); }) .catch(console.error);
const query = new AV.Query('Book'); query.include('genres'); query.find() .then(books => { // This will also fetch all the genre objects for each book const genres = books.map(book => book.get('genres')); }) .catch(console.error);In this example, we're fetching all the Books and including the associated Genre objects using the `include` method. Leanengine Query include is part of the Leancloud SDK for JavaScript. You can find more information about Query include and other query methods in the documentation for the SDK.