Replies: 2 comments
-
This is shown in the MongoDB indexes API documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
-
In the users.class create index section. export const getOptions = app => {
return {
paginate: app.get('paginate'),
Model: app.get('mongodbClient')
.then(db => db.collection('users'))
.then(collection => {
collection.createIndex({phoneNumber: 1}, {unique: true})
return collection
})
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Feathers 5 CLI to generate the project, So i'm confuse about new schema for mongodb and i have question
how to add unique key in string to phoneNumber ? I never see in the documents.
Thanks for reply
Beta Was this translation helpful? Give feedback.
All reactions