Type updates for NeDB

This commit is contained in:
Ryan Blenis 2019-11-11 11:58:23 -05:00
parent b3731ad27f
commit 942eafb70d

4
db.js
View File

@ -897,10 +897,10 @@ module.exports.CreateDB = function (parent, func) {
}
// Add a plugin
obj.addPlugin = function (plugin, func) { obj.pluginsfile.insert(plugin, func); };
obj.addPlugin = function (plugin, func) { plugin.type = "plugin"; obj.pluginsfile.insert(plugin, func); };
// Get all plugins
obj.getPlugins = function (func) { obj.pluginsfile.find().sort({ name: 1 }).exec(func); };
obj.getPlugins = function (func) { obj.pluginsfile.find({"type": "plugin"}, {"type": 0}).sort({ name: 1 }).exec(func); };
// Get plugin
obj.getPlugin = function (id, func) { obj.pluginsfile.find({ _id: id }).sort({ name: 1 }).exec(func); };