Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-469

mongoexport $or query reporting zero records

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0-rc4
    • Component/s: mongoexport
    • Labels:
      None
    • Environment:
      bash

      Description

      I have the following cmd in bash termial

      mongoexport --db fscrap --collection Wall -q "{\$or : [{'insert_time' : {\$gte : new Date(1393624800000)} },{'comments.comment_time' : {\$gte : new Date(1393624800000)}}]}" --out test.json
      it returns zero records while in mongo shell I get the result expected ~ 300 records

      note that I escaped the $ and

      echo "{\$or : [{'insert_time' : {\$gte : new Date(1393624800000)} },{'comments.comment_time' : {\$gte : new Date(1393624800000)}}]}"
      returns

      {$or : [{'insert_time' : {$gte : new Date(1393624800000)} },{'comments.comment_time' : {$gte : new Date(1393624800000)}}]}
      query works in mongo shell

      > db.Wall.find({$or : [{'insert_time' : {$gte : new Date(1393624800000)} },{'comments.comment_time' : {$gte : new Date(1393624800000)}}]}).count()
      328
      SOLVED by downgrading from mongo 2.7.8 (dev version) to stable version 2.6.5

      http://stackoverflow.com/questions/27334866/mongodb-mongoexport-or-query-returns-zero-records

        Attachments

          Activity

            People

            Assignee:
            mpobrien Michael O'Brien
            Reporter:
            y0ft88 Yoft
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: