mongoose-simpledb icon indicating copy to clipboard operation
mongoose-simpledb copied to clipboard

Support for custom index

Open maamve opened this issue 10 years ago • 1 comments

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.

maamve avatar Dec 23 '14 19:12 maamve

Right schema:

exports.schema = { _id: Number, name: {type: String, index: {unique: true}}, email: String, avatar: String };

Santinell avatar Mar 27 '15 09:03 Santinell