Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot to add 'text' indexes #73

Open
OmarOmeiri opened this issue Apr 24, 2021 · 0 comments
Open

Hot to add 'text' indexes #73

OmarOmeiri opened this issue Apr 24, 2021 · 0 comments

Comments

@OmarOmeiri
Copy link

OmarOmeiri commented Apr 24, 2021

Counld not find in the docs a way to add text indexes like you could do with mongoose.
like this:

const mongoose = require('mongoose');
const UserSchema = new mongoose.Schema({

  email: {
    type: String,
    required: true,
  },
  fname: {
    type: String,
    required: true,
  },
  lname: {
    type: String,
    required: true,
  },
});

UserSchema.index({ email: 'text' });
module.exports = User = mongoose.model('user', UserSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant