var mongoose     = require('mongoose');
var Schema       = mongoose.Schema;

var Objectid = mongoose.Schema.Types.ObjectId;
var Mixed = mongoose.Schema.Types.Mixed;

var TagSchema   = new Schema({
	name: { type: String, unique: true, index: true, set: toLower },
	type: { type: String, index: true }
}, {
	timestamps: true
});

TagSchema.set("_perms", {
	admin: "crud",
	user: "cr",
	all: "cr"
});

function toLower (v) {
	return v.toLowerCase();
}

module.exports = mongoose.model('Tag', TagSchema);

@@ -216,22 +216,8 @@
 ing,
- unique: true,
  ind
@@ -307,16 +307,70 @@
 ue%0A%7D);%0A%0A
+TagSchema.index(%7Bname: 1, type: 1%7D, %7Bunique: true%7D);%0A%0A
 TagSchem

Ensure type + name = unique