Closed natew closed 7 years ago
I know the chained .sort()
can be used, but the object notation is actually really helpful for our stack. It lets you parameterize arguments and cache things, as well as gives more flexible api's to your functions (can pass in an object rather than some sort of cb + chain like query => query.sort()...
)
This is a bug. Fix will come.
Please note that RxCollection.insert
is an async function.
If you do
collection.insert({ name: '1233' })
collection.insert({ name: '12344' })
collection.find({ sort: ['name'] }).exec().then(console.log)
then the query will probably not find the two inserted documents. (depending on which storage-engine you use)
I could not reproduce this at the test. I don't know if it's an RxDB issue. Reopen if you have more information.
I still see this btw on the webpackbin: https://www.webpackbin.com/bins/-KjpgcHUKURB4JtitaYe, open the console and I get this error:
Ok i found the issue. As described in the docs, RxCollection.find()
only takes the selector, not the conditions. You cannot pass sort here. Use the sort-function.
Actually, just looked at that doc page and it's not mentioned. Want me to add it?
Apologies for opening all these issues!
Case
https://www.webpackbin.com/bins/-KjpgcHUKURB4JtitaYe
Code
Error: