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

ToArrayTree doesn't sort children nodes #19

Open
burakkilic opened this issue Aug 10, 2015 · 0 comments
Open

ToArrayTree doesn't sort children nodes #19

burakkilic opened this issue Aug 10, 2015 · 0 comments

Comments

@burakkilic
Copy link

Hi;

I have following code:

  var query = {
    condition: {
    },
    fields: {
    },
    sort: {
        order: 1
    }
};
Entity.findOne({
    _id: req.params.entityid
}, function(err, doc) {
    if (err) res.json(err);
    doc.getArrayTree(query, function(err, tree) {
        if (err) res.json(err);
        return res.json({
            type: true,
            data: tree
        });
    });
});

I see that children nodes are not sorted. When I debug, I saw that comes sorted until ToArrayTree was called.

How can we fix it?

@burakkilic burakkilic changed the title How to get full array of 2 root elements? ToArrayTree doesn't sort children nodes Nov 12, 2015
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

No branches or pull requests

1 participant