class AdminController { constructor(database) { this.database = database; }; getAll(onSuccess, onError) { let collection = this.database.collection('publicStates'); let cursor = collection.find({}, {}).toArray(); cursor.then((items) => { onSuccess(items); }); }; }; module.exports = AdminController;