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 7875031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:54:54+00:00 2026-06-03T02:54:54+00:00

in SQL world I could do something to the effect of: SELECT name FROM

  • 0

in SQL world I could do something to the effect of:

SELECT name FROM table WHERE UPPER(name) = UPPER('Smith');

and this would match a search for “Smith”, “SMITH”, “SmiTH”, etc… because it forces the query and the value to be the same case.

However, MongoDB doesn’t seem to have this capability without using a RegEx, which won’t use indexes and would be slow for a large amount of data.

Is there a way to convert a stored value to a particular case before doing a search against it in MongoDB?

I’ve come across the $toUpper aggregate, but I can’t figure out how that would be used in this particular case.

If there’s not way to convert stored values before searching, is it possible to have MongoDB convert a value when it’s created in Mongo? So when I add a document to the collection it would force the “name” attribute to a particular case? Something like a callback in the Rails world.

It looks like there’s the ability to create stored JS for MongoDB as well, similar to a Stored Procedure. Would that be a feasible solution as well?

Mostly looking for a push in the right direction; I can figure out the particular code once I know what I’m looking for, but so far I’m not even sure if my desired functionality is doable.

  • 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-03T02:54:55+00:00Added an answer on June 3, 2026 at 2:54 am

    You have to normalize your data before storing them. There is no support for performing normalization as part of a query at runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The SQL would be something like select GeneralData.id, GeneralData.name, GeneralData.last_name, Student.id from GeneralData Inner
When doing linq-to-sql in c#, you could do something like this: var data =
I was wondering if you could do something like this is Microsoft SQL Server
Coming from the MS SQL world, I tend to make heavy use of stored
I'm from SQL world, so please, don't ask me that there are no tables,
I am new to writing SQL and would greatly appreciate help on this problem.
i want to realize a construct in MS SQL that would look like this
I'm a bit rusty with my SQL. I thought I could do something like
Suppose I have a SQL database in which a column could look something like
Is there something available that could help me convert a XSD into SQL relational

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.