array.findBy returning an array?
See original GitHub issueI’ve tested it and I can’t seem to get array.findBy
to return the true value that is being returned from Ember.Array.findBy
...
myArray: computed(..., function() {
return [{
"name": "Object 1",
"isActive": true
},{
"name": "Object 2",
"isActive": false
},{
"name": "Object 3",
"isActive": false
}];
}),
activeRow: array.findBy('myArray','isActive',true) // returns [ {...}, {...}, {...} ]
...
Meanwhile…
myObject.get('myArray').findBy('isActive') // returns {...}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Return array with Doctrine findBy method - Stack Overflow
I am using the Doctrine findBy() method, but I want to get arrays returned instead of objects. This is my query:
Read more >Array.prototype.find() - JavaScript - MDN Web Docs - Mozilla
A function to execute for each element in the array. It should return a truthy value to indicate a matching element has been...
Read more >Query an Array — MongoDB Manual
To query if the array field contains at least one element with the specified value, use the filter { <field>: <value> } where...
Read more >About Queries | Testing Library
findAllBy... : Returns a promise which resolves to an array of elements when any elements are found which match the given query.
Read more >JavaScript Array find() Method - GeeksforGeeks
Syntax: · Parameters: This method accepts 5 parameters as mentioned above and described below: · Return value: It returns the array element value ......
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
@jfrux, no problem. I have made the same mistake myself and so have several of my colleagues. You are in good and plentiful company here 😃
Thanks @mriska!