From 7e04658d69994633b6b262ba89a58cf6aad9af4d Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Thu, 27 Feb 2014 14:03:29 +0100 Subject: [PATCH] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a0cc23..3894334 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ db.robots.loadDatabase(); ### Compacting the database Under the hood, NeDB's persistence uses an append-only format, meaning that all updates and deletes actually result in lines added at the end of the datafile. The reason for this is that disk space is very cheap and appends are much faster than rewrites since they don't do a seek. The database is automatically compacted (i.e. put back in the one-line-per-document format) everytime your application restarts. -You can manually call the compaction function with `yourDatabase.persistence.compactDatafile` which takes a `callback(err)` as argument. +You can manually call the compaction function with `yourDatabase.persistence.compactDatafile` which takes no argument. It queues a compaction of the datafile in the executor, to be executed sequentially after all pending operations. You can also set automatic compaction at regular intervals with `yourDatabase.persistence.setAutocompactionInterval(interval)`, `interval` in milliseconds (a minimum of 5s is enforced), and stop automatic compaction with `yourDatabase.persistence.stopAutocompaction()`.