Skip to content
This repository has been archived by the owner on Jul 14, 2019. It is now read-only.

Support for custom index #15

Open
maamve opened this issue Dec 23, 2014 · 1 comment
Open

Support for custom index #15

maamve opened this issue Dec 23, 2014 · 1 comment

Comments

@maamve
Copy link

maamve commented Dec 23, 2014

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.

@Santinell
Copy link
Contributor

Right schema:

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants