Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8611123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:17:36+00:00 2026-06-12T04:17:36+00:00

I want to make a case insensitive mongoid query on a mission title. Lets

  • 0

I want to make a case insensitive mongoid query on a mission title.

Lets say the model looks like:

class Mission
  include Mongoid::Document

  field :title
  filed :description
end

Can this be accomplished with a mongoid scope/index and what would it look like?

Also, Is better practice to denormalize the data and hold a indexable lowercase field and if so what would that look like?

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:17:38+00:00Added an answer on June 12, 2026 at 4:17 am

    If this is a field you will be indexing the best solution is to add an additional field which holds an lower/upper case version of your field as suggested here.

    If not, you can query by a case insensitive regex. This will have performance impacts however so tred lightly.

    db.Mission.find({"title" : /foo/i})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a case sensitive comparision like this: If ARGV[0].eql? /word/i print
Let's say I want to make a special case for a function that matches
In SQLite I want to case-insensitive SELECT LIKE name works fine for normal latin
Possible Duplicate: Case insensitive std::string.find() I want to make use of the std::string::find() method
I'm trying to make the usernames case insensitive but I still want to store
Let's say I want make some of my sources publicly available via my blog
I have style sheet with a class name changebackgroundcolor i want make change in
I know awk has IGNORECASE to make the operation case insensitive. But I am
I have an existing TestNG test case. I want to make a stress test
I want to make MinGW validate that the file names specified in #include directives

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.