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

compactDatafile remove ttl index configuration from datastore file #62

Open
andrea-tomassi opened this issue Nov 13, 2024 · 0 comments
Open

Comments

@andrea-tomassi
Copy link

Bug Report: TTL Index Information Lost After compactDatafile Function Call

Description

When the compactDatafile function is called on a datastore that has a TTL index, the information related to the TTL index is deleted. This means that any automatic deletion of documents based on the TTL index will no longer occur after the compaction.

To Reproduce

  1. Create a NeDB datastore and add a TTL index to it.
  2. Insert some documents that should be affected by the TTL index.
  3. Call the compactDatafile function on the datastore.
  4. Observe that the TTL index information is lost, and documents are no longer automatically deleted based on the TTL.

Expected Behavior

The expected behavior is that after calling compactDatafile, the TTL index should remain intact, and documents should continue to be automatically deleted according to the TTL settings.

Actual Behavior

The actual behavior is that the TTL index information is deleted, and documents are no longer automatically deleted based on the TTL.

Logs

Logs would typically show the compaction process but might not explicitly indicate the deletion of the TTL index information unless additional logging is added.

Environment Info

  • Runtime: Node 20
  • NeDB Version: 4.0.4
  • OS: Kubernetes Pod
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