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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:10:14+00:00 2026-05-28T01:10:14+00:00

Ok this one is killing me. Maybe its late and I am forgetting something,

  • 0

Ok this one is killing me. Maybe its late and I am forgetting something, but this should work.

For test purposes, I have about 6000 documents in my collection. There is a property called Priority which has a value of 2 in every instance.

The following two queries each return all 6000 documents:

{
    Priority: {
        $gt: 1
    }
}

and

{
    Priority: {
        $lt: 10
    }
}

This query, however, returns 0 results and according to the Explain, does a full scan of all 6000 documents:

{
$and: [
        {
            Priority: {
                $gt: 1
            }
        },
        {
            Priority: {
                $lt: 10
            }
        }
    ]
}

Have I missed something?

  • 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-05-28T01:10:14+00:00Added an answer on May 28, 2026 at 1:10 am

    If I said, “I need someone with a car that can seat four people and a car that can seat at least eight people”, someone with a single car that sat eight people would not ordinarily be understood to qualify. Your and query can only be satisfied by an entry with two values for Priority, one less than 10 and one greater than 1.

    The docs for and have a link to the multikey semantics of mongoDB.

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

Sidebar

Related Questions

This one is a real head scratcher for me... var matches = Regex.Matches(<p>test something<script
This one seems to be a simple problem, but I can't make it work
We've reproduced this one in Test, so I feel good about asking this question
This one has been stumping me for a while. But I'm no expert. This
Hi this question or problem i have its very hard i have search and
This one is killing me. I'm trying to make a simple console app that
This one is killing me... I'm learning to develop SOAP servers in PHP at
Ok guys, this one is literally killing my mind, as I've been able to
This one is killing me,i'm a total noob with regex. Im trying to make
This one is killing me: echo preg_match(/([a-zA-Z0-9\-\.]+)\.([a-zA-Z0-9]+)/,'downcom'); This one print 0 , because it

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.