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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:45:43+00:00 2026-05-26T02:45:43+00:00

i started with mongodb and played around with random temperature data like this: ‘weather’

  • 0

i started with mongodb and played around with random temperature data
like this:

'weather' => array(
                    'Air' => array(
                        'Jan' => 11,
                        'Feb' => 20,
                        'Mar' => 24,
                        'Jun' => 28,
                        'Jul' => 30
                    )
                ),

Now my question:
How can i query the Air array ?

I knwo i can do somethin like:

$query = array('weather.Air.Jan' => 11);

Works fine…

But how can i search in the whole Air array:

$query = array('weather.Air.$' => 40);

This query doesn’t work…
Can somebody help me

  • 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-26T02:45:43+00:00Added an answer on May 26, 2026 at 2:45 am

    Unfortunately, the query you’re looking for does not exist.

    As written, you’re asking for “weather.Air where a key in the JSON object contains a value of 40”.

    MongoDB has the ability to “drill into” arrays. However, when it comes to sub-objects, you have to reach into the keys directly. There is no operator that provides a “search all keys” method. There is an outstanding JIRA request for this item right here.

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

Sidebar

Related Questions

I have some data in MongoDB that looks like this: { name: Steve, location:
I just started to play around with MongoDB (C#) and tried to port a
This question is for all NoSQL and specially mongoDB experts out there. I started
Started with this question: OpenID. How do you logout OK. So OpenID does not
I've just started working with mongodb got a perl script that parses a twitter
Started to play around with Jenkins. Created new job and entered SVN repository URL.
Started using thinking sphinx today and I'd like to know what's going wrong here:
I am getting started with a non-SQL database (specifically, MongoDB) and Ruby on Rails
I started studied MongoDB about 2~3 days ago, and I am feeling pretty happy
I've recently started testing MongoDB via shell and via PyMongo. I've noticed that returning

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.