diff --git a/meilidb-core/src/store/main.rs b/meilidb-core/src/store/main.rs index eb1921b07..085609e4f 100644 --- a/meilidb-core/src/store/main.rs +++ b/meilidb-core/src/store/main.rs @@ -75,7 +75,7 @@ impl Main { Ok(new) } - pub fn number_of_documents(&self, reader: &zlmdb::RwTxn) -> ZResult { + pub fn number_of_documents(&self, reader: &zlmdb::RoTxn) -> ZResult { match self.main.get::>(reader, NUMBER_OF_DOCUMENTS_KEY)? { Some(value) => Ok(value), None => Ok(0),