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

field level descending index? #8895

Closed
bonesoul opened this issue Apr 29, 2020 · 0 comments · Fixed by #8896
Closed

field level descending index? #8895

bonesoul opened this issue Apr 29, 2020 · 0 comments · Fixed by #8896
Assignees
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Milestone

Comments

@bonesoul
Copy link

documentation mentions;

  var animalSchema = new Schema({
    name: String,
    type: String,
    tags: { type: [String], index: true } // field level
  });

  animalSchema.index({ name: 1, type: -1 }); // schema level

is it even possible to create a descending index within field level?

tried
tags: { type: [String], index: -1 }

but can't get it working?

@AbdelrahmanHafez AbdelrahmanHafez added this to the 5.9.12 milestone Apr 29, 2020
@AbdelrahmanHafez AbdelrahmanHafez added the new feature This change adds new functionality, like a new method or class label Apr 29, 2020
@AbdelrahmanHafez AbdelrahmanHafez self-assigned this Apr 29, 2020
AbdelrahmanHafez added a commit to AbdelrahmanHafez/mongoose that referenced this issue Apr 29, 2020
@AbdelrahmanHafez AbdelrahmanHafez added enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature and removed new feature This change adds new functionality, like a new method or class labels Apr 29, 2020
vkarpov15 added a commit that referenced this issue May 2, 2020
allow adding descending indexes on schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants