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

SoftDelete not working with MongoDB #4

Open
hgoebl opened this issue Apr 4, 2017 · 1 comment
Open

SoftDelete not working with MongoDB #4

hgoebl opened this issue Apr 4, 2017 · 1 comment

Comments

@hgoebl
Copy link

hgoebl commented Apr 4, 2017

The "not-deleted" filter queryNonDeleted = {[options.deletedAt]: null} is translated into { deleted_at: { '$type': 10 } }. This query won't find any record. What we'd need is more like deleted_at: {$exists: false}. Unfortunately I don't know whether there is an expression which gets translated to this and hopefully stills works with other databases.

Maybe using "deletedBy" would be easier than using a date?

From server log:

2017-04-04T16:54:47.309Z - debug:   loopback:connector:mongodb all news { limit: 10, skip: 0, where: { deleted_at: null }, offset: 0 } +1ms
2017-04-04T16:54:47.309Z - debug:   loopback:connector:mongodb MongoDB: model=news command=find [ { deleted_at: { '$type': 10 } }, [Function] ] +1ms
@itaimoorali
Copy link

Whats the status on this @jouke ??? are fixing this ? i am having the same issue.

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

2 participants