Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #4.9

Querying Our Movies with the Query Builder

In This Lesson

We'll introduce both the database and model query builder. We'll learn the differences between the two and the basics of how to use them.

Created by
@tomgobich
Published

Join the Discussion 2 comments

Create a free account to join in on the discussion
  1. @cortesbr

    Hi! I noticed that in your tutorial, you're able to directly use the movie objects returned from queries, but in my Adonis.js v6 project, I had to use .toObject() to handle the Lucid ORM proxy objects. Is this because the tutorial was written for an earlier version of Adonis? Could you clarify this difference in behavior between versions?

    1
    1. Responding to cortesbr
      @tomgobich

      Hi cortesbr! You shouldn't need to call toObject() to access the model's properties; you should be able to directly reference them via movie.id, for example. Please make sure you're using at least NodeJS v20. If you are using NodeJS v20 or later, please feel free to share your repository and I can see if anything stands out.

      0