question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

findAll issue when resource returns empty collection

See original GitHub issue

When using findAll and specifiying idAttribute in the model, if server returns empty collection, I get

“attrs” must contain the property specified by “idAttribute”.

I couldn’t find a way how to handle this case, or documentation related to this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jmdobrycommented, May 24, 2017

@Tronix117 is right, findAll was expecting the response to be an array and was injecting it into the store. v2 provides a few hooks where you could instruct js-data to use that nested data field, and v3 has even more hooks. There isn’t a single answer on how you would approach this.

1reaction
Tronix117commented, May 23, 2017

Great, also don’t forget to include versions of js-data and adapters, in future issues, because there is some major changes with v3 and it behaves differently (not on this matter though)

Read more comments on GitHub >

github_iconTop Results From Across the Web

findAll returns empty set, logged raw query returns desired ...
The following query works: SELECT `Image`.`id`, `Image`.`title`, `Image`.`pageid`, `Image`.`url`, `Image`.`imageurl`, `Image`.
Read more >
JpaRepository findAll returns empty List - java - Stack Overflow
The problem is that your properties are not mutable. You have exposed getters and setters but you didn't specify access level, ...
Read more >
Finding resources to tag - AWS Tag Editor - AWS Documentation
The search is case sensitive. Leave the Tags boxes empty to find all resources of the specified type in the selected AWS Regions....
Read more >
find( ) returning an empty object when called from a trigger
To get the data from the post collection, I'm executing post.find( ) but I'm getting an empty object. What am I doing wrong?...
Read more >
Search Query Reference | YouTrack Server Documentation
To find all issues that are assigned to sprint 21 on the YouTrack Scrum board, enter Board ... Returns issues that do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found