AnsweredAssumed Answered

How can you use BeanCollection.fetch to retrieve distinct values?

Question asked by Jeff Bickart on Jan 4, 2016
Latest reply on Oct 24, 2016 by Francesca Shiekh

I in my Accounts module I have added a brand field. I would like to only find the Unique brands available and not every  record in the DB

 

 

[{brand:'audi',id:'1234'},
{brand:'audi',id:'3456'},
{brand:'bmw',id:'3456'}]

 

 

my code looks like:

var accounts = app.data.createBeanCollection('Accounts');
accounts.fetch({
  success: function(data) { 
    console.log(data);
  }
});

 

Ideally I could say, something like unique ('brand') or distinct inside of the fetch

 

Any ideas?

Outcomes