Virtual attributes are ignored inside the include section
See original GitHub issueWhat am I doing?
await Question.findAll({
attributes: ['id', 'name'],
include: {
model: Video,
attributes: ['id', '...', 'resourceUrl'], // resourceUrl - virtual string type
include: {
model: Image,
as: 'poster',
attributes: ['id', '...', 'resourceUrl'], // resourceUrl here - virtual string type too
},
},
})
What do I expect to happen?
I expected the Video
and Poster
models to have the attribute "resourceUrl"
What is actually happening?
But all specified attributes returned except the virtual ones…
Dialect: postgres Dialect version: 7.8.2 Database version: 10.7 Sequelize version: 5.1.0 Tested with latest release: Yes, 5.1.0 (If yes, specify that version)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Virtual attribute is being ignored - ruby on rails - Stack Overflow
I'm having some strange problem with virtual attributes in rails. Here is my example model. ... Right now the first_name = nil part...
Read more >Virtual attribute limitations - Documentation - Ping Identity
There is currently no method to prevent attempts to write to attributes with virtual values. The NO-USER-MODIFICATION constraint in attribute ...
Read more >Configuring Virtual Attributes
Configuring Virtual Attributes. Virtual attributes are attributes whose values do not exist in persistent storage but are dynamically generated in some way.
Read more >mod_include - Apache HTTP Server Version 2.4
Therefore, you cannot include files that are outside of the document root, or above the current document in the directory structure. The virtual...
Read more >The Manifest Format - The Cargo Book
The first section in a Cargo.toml is [package] . ... In Rust, breaking changes include adding fields to structs or variants to enums....
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 Free
Top 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
I’m trying this approach in 5.8.0 but there should be next error.
I have defined Virtual field in model A like this:
Then i’m calling Model B which should include Model A as array of these models via:
It’s properly called but it’s not in the result. Any idea?
@askynet mine was to do another request with the id of the included field to get virtual fields through it.