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

The Archive Base Latest Questions

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

I am trying to look on the field: [case-file-header] => Array ( [filing-date] =>

  • 0

I am trying to look on the field:

[case-file-header] => Array (
                      [filing-date] => 20130111)

like this:

$cursor = $mongo->$db->$collection->find(array('case-file-header'=>
                                                     array('filing-date' => 
                                                                 array('$in' => array($current_date)))));

what am I doing wrong?

My collection consists of 7 million records. Here’s an example of one record:

[_id] => MongoId Object (
    [$id] => 50f5a5630c7263b79a373390
)
[serial-number] => 76713205
[registration-number] => 0000000
[transaction-date] => 20130114
[case-file-header] => Array (
   [filing-date] => 20130111
   [status-code] => 630
   [status-date] => 20130114
   [mark-identification] => ALPHACHEMICAL
   [mark-drawing-code] => 3000
   [attorney-docket-number] => 113,328
   [attorney-name] => William Nitkin
   [principal-register-amended-in] => F
   [supplemental-register-amended-in] => F
   [trademark-in] => T
   [collective-trademark-in] => F
   [service-mark-in] => F
   [collective-service-mark-in] => F
   [collective-membership-mark-in] => F
   [certification-mark-in] => F
 )
  • 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-17T10:36:36+00:00Added an answer on June 17, 2026 at 10:36 am

    You should really use the positional operator instead since MongoDB will actually try something else when you make nesting like:

    array('case-file-header'=>
    array('filing-date' => 
    

    So:

    $mongo->$db->$collection->find(array(
        'case-file-header.filing-date' => array('$in' => array($current_date))
    ));
    

    Should work

    This is an exact sample that works with the doc you showed:

    $mongo = new Mongo();
    $db = $mongo->mydb;
    
    $current_date = 20130111;
    
    $db->some_test_collection->insert(array(
        '_id' => new MongoId('50f5a5630c7263b79a373390'),
        'serial-number' => 76713205,
        'registration-number' => 0000000,
        'transaction-date' => 20130114,
        'case-file-header' => Array(
           'filing-date' => 20130111,
           'status-code' => 630,
           'status-date' => 20130114,
           'mark-identification' => 'ALPHACHEMICAL',
           'mark-drawing-code' => 3000,
           'attorney-docket-number' => '113,328',
           'attorney-name' => 'William Nitkin',
           'principal-register-amended-in' => 'F',
           'supplemental-register-amended-in' => 'F',
           'trademark-in' => 'T',
           'collective-trademark-in' => 'F',
           'service-mark-in' => 'F',
           'collective-service-mark-in' => 'F',
           'collective-membership-mark-in' => 'F',
           'certification-mark-in' => 'F'
        )
    ));
    $cursor = $db->some_test_collection->find(array('case-file-header.filing-date' => array('$in' => array($current_date))));
    foreach($cursor as $row) var_dump($row);
    var_dump($cursor->count());
    exit();
    

    With the output being:

    int 1
    
    array
      '_id' => 
        object(MongoId)[5]
          public '$id' => string '50f5a5630c7263b79a373390' (length=24)
      'serial-number' => int 76713205
      'registration-number' => int 0
      'transaction-date' => int 20130114
      'case-file-header' => 
        array
          'filing-date' => int 20130111
          'status-code' => int 630
          'status-date' => int 20130114
          'mark-identification' => string 'ALPHACHEMICAL' (length=13)
          'mark-drawing-code' => int 3000
          'attorney-docket-number' => string '113,328' (length=7)
          'attorney-name' => string 'William Nitkin' (length=14)
          'principal-register-amended-in' => string 'F' (length=1)
          'supplemental-register-amended-in' => string 'F' (length=1)
          'trademark-in' => string 'T' (length=1)
          'collective-trademark-in' => string 'F' (length=1)
          'service-mark-in' => string 'F' (length=1)
          'collective-service-mark-in' => string 'F' (length=1)
          'collective-membership-mark-in' => string 'F' (length=1)
          'certification-mark-in' => string 'F' (length=1)
    

    So there must be something else wrong somewhere

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

Sidebar

Related Questions

I've been trying to avoid using a cursor in this particular case just because
I've been trying to look in the wiki about doing this, I'm following it,
I have a value I am trying to index that looks like this: Test
Im trying to make this dynamic email input field which uses autocomplete on a
A Case in CRM has a field called Status with four options. I'm trying
Im trying to look into using the WPF WriteableBitmap class to allow my application
I am trying to look at an execution plan for a sproc that has
I am trying to look up a QueueConnectionFactory and Queue via Geronimo's JNDI. The
I'm trying to look for a unique 32-bit integer that I can access in
I've been been trying to look for a piece of javascript code that compares

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.