Skip to content

Commit

Permalink
update bot schema
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Dec 27, 2013
1 parent dbe15aa commit 1a36199
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions db/models/bots.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
var mongoose = require('mongoose');

var botSchema = new mongoose.Schema({
bot_id: {type: String, unique: true},
bot_name: String,
bot_key: String,
bot_state: {type: Boolean, default: false},
bot_visible: Boolean, // After having the user
id: {type: String, unique: true},
name: String,
key: String,
state: {type: Boolean, default: false},
visible: Boolean, // After having the user
address: String,
commands: [String], // List of commands available to execute
livefeedurl: String,
photourl: String,
liveFeedURL: String,
photoURL: String,
description: String,
});

botSchema.statics.findByBotId = function (botId, cb) {
this.find({ bot_id: botId }, cb);
this.find({ id: botId }, cb);
};

botSchema.statics.findAll = function (cb) {
this.find({},cb);
};




var Bot = module.exports = mongoose.model('Bot', botSchema);

0 comments on commit 1a36199

Please sign in to comment.