NeDB-based database hosted on Discord
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KaKi87 ecf00ac308 ✏️ Fix typo 2 years ago
.gitignore 🎉 Initial commit 2 years ago 🔧 📝 As per 8d0c22a 2 years ago
index.js ✏️ Fix typo 2 years ago
package.json 🔧 📝 As per 8d0c22a 2 years ago
yarn.lock ♻️ Replace 'nedb' dependency by 'nedb-promises' 2 years ago

Discord NeDB

NeDB-based database hosted on Discord.


From npm :

  • yarn add discord-nedb


  • npm install discord-nedb

Built with



const Datastore = require('discord-nedb');

const database = new Datastore(

const messageId = await database.loadDatabase();
  • The token parameter is a required bot token
  • Either provide guildId + channelId or userId
  • When messageId is undefined, a new message will be created
  • Always call loadDatabase, which will return messageId, especially useful at first initialization

Data manimulation

Methods provided by nedb-promises (check Datastore docs) :


  • find
  • findOne
  • count


  • update
  • remove
  • ensureIndex
  • removeIndex

Database compaction

await database.persistence.compactDatafile();

Database compaction is automatically called when the message exceeds Discord's maximum limit.

If compaction doesn't free enough space for additional data, an error will be thrown.

Database deletion

await database.deleteDatabase(
  • When isDeletingLocally is true (default), the local database file is deleted.
  • When isDeletingRemotely is true (not default), the Discord message is deleted.


  • 0.1.0 (2020-12-17) • Initial release


This project is released under the MIT license.