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

simpleSort with useJavascriptSorting don't support dotNotation #921

Open
Losses opened this issue Dec 4, 2022 · 0 comments
Open

simpleSort with useJavascriptSorting don't support dotNotation #921

Losses opened this issue Dec 4, 2022 · 0 comments

Comments

@Losses
Copy link

Losses commented Dec 4, 2022

Here's the implementation:

LokiJS/src/lokijs.js

Lines 3295 to 3301 in 25b9a33

if (options.useJavascriptSorting) {
return this.sort(function (obj1, obj2) {
if (obj1[propname] === obj2[propname]) return 0;
if (obj1[propname] > obj2[propname]) return 1;
if (obj1[propname] < obj2[propname]) return -1;
});
}

But the unit test is trying to use this feature here:

var results = coll.chain().find(
{ 'nested.count': { $in: [15, 73] } }
).simplesort('nested.count').data();

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