Open pulkitsinghal opened 9 years ago
After you follow the steps above to reproduce the problem: You will see a failure like the following in logs when you run DEBUG=loopback:connector:* mocha
:
loopback:connector:elasticsearch ESConnector.prototype.all +0ms model User result [
{
"seq": 1,
"name": "a",
"vip": true
},
{
"seq": 2,
"name": "b"
},
{
"seq": 3,
"name": "c"
}
]
Possibly unhandled AssertionError: expected [ 'a', 'b', 'c' ] to deeply equal [ 'c', 'b', 'a' ]
at /Users/pulkitsinghal/dev/shoppinpal/loopback-connector-elasticsearch/test/02.basic-querying.test.js:160:38
at /Users/pulkitsinghal/dev/shoppinpal/loopback-connector-elasticsearch/node_modules/loopback-datasource-juggler/lib/dao.js:721:5
at allCb (/Users/pulkitsinghal/dev/shoppinpal/loopback-connector-elasticsearch/node_modules/loopback-datasource-juggler/lib/dao.js:1210:7)
at /Users/pulkitsinghal/dev/shoppinpal/loopback-connector-elasticsearch/lib/esConnector.js:705:17
...
@raymondfeng - Is the core code unable to sort when the id is represented by something other than id
? Like seq
in this example? If so, would you mind opening an issues in the appropriate repository and leaving a reference to it here as well.
I've temporarily commented out the part of the test which fails.
The original test case was available at: https://github.com/strongloop/loopback-datasource-juggler/blob/master/test/basic-querying.test.js
I simply copied and repurposed it here: https://github.com/strongloop-community/loopback-connector-elastic-search/blob/master/test/02.basic-querying.test.js
In order to reproduce the problem:
comment-out the following lines: