What is query?
See original GitHub issueThe question/issue is probably as weird as the title is.
I’m trying to figure out what ctx.query is. This is what I’m talking about:
console.log({
obj: ctx.query,
type: typeof ctx.query,
prototype: ctx.query.prototype,
constructor: ctx.query.constructor,
isObj: ctx.query.constructor === Object,
});
Result:
{ obj: { name: 'test' },
type: 'object',
prototype: undefined,
constructor: undefined,
isObj: false }
Why is it not a pojo? What is its constructor? I can easily work around this by using Object.assign({}, ctx.query) but I’m really curious.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
What is Query? - Definition from Techopedia
A query is a request for data or information from a database table or combination of tables. This data may be generated as...
Read more >What is a database query? - TechTarget
A query is a question or a request for information expressed in a formal manner. In computer science, a query is essentially the...
Read more >What Is a Query? Database Query Explained - Hostinger
In standard English, a query means a request for information. In computer programming, it refers to the same thing, except the information is...
Read more >Query Definition & Meaning - Merriam-Webster
1 · to ask questions of especially with a desire for authoritative information ; 2 · to ask questions about especially in order...
Read more >Introduction to queries - Microsoft Support
A query can give you an answer to a simple question, perform calculations, combine data from different tables, add, change, or delete data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yea,
{ ...obj }
is syntactic sugar forObject.assign
.I’m using Object.assign, which works as well. I wish I could detect it instead of forcing it though, so I’ll find a way.
Thanks again!