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

TypeError: operator Package[operator] is not a function; with a (temporary) fix #166

Open
patarapolw opened this issue Apr 24, 2019 · 0 comments

Comments

@patarapolw
Copy link

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[x] Temporary fix / possible long term fix

Current behavior

Some filters used in find() does not work as it should with LokiJS or MongoDB. For example,

{$and: [
    {tag: "marked"},
    {$or: [
        {nextReview: {$exists: false}},
        {nextReview: {$in: [null, ""]}},
        {nextReview: {$lt: new Date()}}
    ]}
]}

What is the motivation / use case for changing the behavior?

I am not writing the filter object directly, but by parsing a string with parsimmon https://github.com/patarapolw/zhdiary-app/blob/master/src/backend/db/MongoQParser.ts.

Temporary fix? MongoToFilter function, and use JavaScript's filter in .where().

Environment


LokiDB version: 2.0.0-beta.8 with @lokidb/fs-storage 2.0.0-beta.8
Browser/Node version: Node v11.11.0 Yarn 1.15.2 MacOS
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