Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to sort on nested properties #26

Closed
noirbizarre opened this issue Jul 23, 2015 · 0 comments · Fixed by #27
Closed

Allow to sort on nested properties #26

noirbizarre opened this issue Jul 23, 2015 · 0 comments · Fixed by #27

Comments

@noirbizarre
Copy link
Contributor

Hi!

I'm lacking sorting on nesting property (and potentialy search on).

Imagine the following objects:

let data = [
    {name: 'John Doe', metrics: {a: 15, b:17}},
    {name: 'Jane Doe', metrics: {a: 18, b:2}}
];

I want to be able to write:

let s = new Sifter(data).search('', {
    fields: [],
    sort: [{field: 'metrics.a', direction: 'asc'}]
});

Is there a way to do this today ?

@noirbizarre noirbizarre changed the title Allow to sort on nested property Allow to sort on nested properties Jul 23, 2015
@holic holic closed this as completed in #27 Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant