I've removed query-to-mongo package, because it doesn't work correctly with complex queries, it also did a lot of unnecessary stuff.
I have implemented custom function queryToMongo instead, which supports pagination and returns JS object with the following properties:
criteria (search mongo query)
options (mongo options, like limit, sort, and offset)
links (function which calculates links for pagination, this function uses the same mechanism that mongo-to-query does)
This solution will not break anything, because a lot of features from mongo-to-query were not used in radiks-server. Also I've found out that there was a problem with complex queries stringification in radiks repo. It's solved here https://github.com/blockstack/radiks/pull/71. So this commit should be applied also to fix the issue.
I have also added some simple tests to ensure that radiks-server can support (at least doesn't raise an error) for complex queries with $or operator.
This PR solves this issue: https://github.com/blockstack/radiks/issues/67
I've removed query-to-mongo package, because it doesn't work correctly with complex queries, it also did a lot of unnecessary stuff.
I have implemented custom function queryToMongo instead, which supports pagination and returns JS object with the following properties:
This solution will not break anything, because a lot of features from mongo-to-query were not used in radiks-server. Also I've found out that there was a problem with complex queries stringification in radiks repo. It's solved here https://github.com/blockstack/radiks/pull/71. So this commit should be applied also to fix the issue.
I have also added some simple tests to ensure that radiks-server can support (at least doesn't raise an error) for complex queries with $or operator.