Skip to content

[Bug]: Could not filter collection by date #549

@wael7721

Description

@wael7721

Version

Version 0.0.3

App

  • Cursor
  • Windsurf
  • VSCode
  • VSCode Insiders
  • Claude Desktop
  • Other

Affected Models (if applicable)

  • Claude 3.5 Sonnet
  • Claude 3.7 Sonnet
  • GPT-4a
  • o4-mini
  • Other

Bug Description

The MCP Failed to filter by date (Found 0 documents in the collection hidden) despite queries being correct

_Now let me check the date range of all evaluations to see what dates we actually have:

[MongoDB (MCP Server)]
Interesting! The data shows there ARE evaluations up to August 25, 2025. Let me now specifically count those from August 2025:_

{
  "collection": "hidden"
  "database": "db",
  "query": {
    "created": {
      "$gte": {
        "$date": "2025-08-01T00:00:00.000Z"
      },
      "$lt": {
        "$date": "2025-09-01T00:00:00.000Z"
      }
    }
  }
}

Output
Found 0 documents in the collection hidden...

Model attempted several queries but couldn't get any document back, it knows documents that match the condition exist (because it used aggregate tool with date expression operators)

{
  "collection": "hidden",
  "database": "db",
  "pipeline": [
    {
      "$addFields": {
        "year": {
          "$year": "$created"
        },
        "month": {
          "$month": "$created"
        }
      }
    },
    {
      "$match": {
        "year": 2025,
        "month": 8
      }
    },
    {
      "$count": "august_count"
    }
  ]
}

This is puzzling. The aggregation shows a max date of August 25, 2025, but I can't find those records. Let me sort by created date descending to see the most recent ones:...

I can see from the sorted results that there are records with dates like "2025-08-25T10:56:44.046Z"...

Can someone test this to confirm?

Metadata

Metadata

Assignees

Labels

pending-releaseFor issues and bugs that have been fixed but waiting for a release.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions