mongoose-simpledb
mongoose-simpledb copied to clipboard
Support for custom index
Based on ... exports.schema = { _id: Number, name: String, email: String, avatar: String };
I tried ... exports.schema.index({name:1}, {unique: true}); and... exports.index({name:1}, {unique: true});
but neither works. How can i achieve this. Thanks. Great work btw.
Right schema:
exports.schema = { _id: Number, name: {type: String, index: {unique: true}}, email: String, avatar: String };