How to use AdonisJS v6 Repl to read data #4455
-
In another version adonisjs to read data in Repl I can use query() why in v6 I can't use the query builder like below this
but for create method it works with adonisjs v6 Repl to read data I want to be able to use query builders like all(), find(), findBy() and others |
Beta Was this translation helpful? Give feedback.
Answered by
Julien-R44
Mar 12, 2024
Replies: 2 comments 4 replies
-
not sure if i understand your problem. the REPL code you just posted works fine. what's the error or issue you are facing? await loadModels()
const user = await models.user.query().select().first()
user.name // will print the user name in the repl |
Beta Was this translation helpful? Give feedback.
4 replies
-
thank you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yeah that's normal. in the first case, it returns instances of
User
. in the second case, it's just standard json, plain POJOsread this
in your first screenshot, if you write
users[0].id
you'll get the id displayed in the REPL