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

Calling Datastore#persistence#compactDatafile is deprecated #72

Closed
Gikkman opened this issue Jun 23, 2024 · 1 comment · May be fixed by #73
Closed

Calling Datastore#persistence#compactDatafile is deprecated #72

Gikkman opened this issue Jun 23, 2024 · 1 comment · May be fixed by #73
Labels

Comments

@Gikkman
Copy link

Gikkman commented Jun 23, 2024

I moved over to using nedb-promises over plain nedb due to their Typescript types having issues. So far, it's been working great. The only thing I've noticed is that calling

database.persistance.compactDatafile()

will print a warning to the console with the following message:

(node:13872) DeprecationWarning: @seald-io/nedb: calling Datastore#persistence#compactDatafile is deprecated, please use Datastore#compactDatafile, it will be removed in the next major version.

This is due to @seald/nedb having marked calls going via .persistence as deprecated. Instead, they want us to call the functions straight on the database object. Like this:

database.compactDatafile()

The nedb-promises types file currently does not expose these functions. But there is a work-around in the mean time, to cast the object to any before making the call. So the method is there, it just isn't exposed.

(database as any).compactDatafile();
Copy link

stale bot commented Aug 25, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 25, 2024
@stale stale bot closed this as completed Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant