You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title:
ObjectId query syntax fails in MCP tools with "unknown operator: $oid" error
Description:
Problem
When attempting to query documents using ObjectId references in MongoDB MCP tools, queries consistently fail with the error "unknown operator: $oid". This occurs when using standard MongoDB syntax for querying by ObjectId.
Steps to reproduce
Attempt to query a collection using the MCP MongoDB tools
Use a filter containing an ObjectId reference with standard syntax:
Apply to mcp.json
}
Observe the error: "Error running find: unknown operator: $oid"
Failed queries
The following query patterns all produce the same error:
{"_id": {"$oid": "..."}}
{"userId": {"$oid": ""..."}}
{"_id": {"$eq": {"$oid": ""..."}}}
Using the string format without $oid operator does not retrieve documents:
{"_id": ""..."}
Expected behavior
The MCP tools should properly translate the ObjectId query syntax to the appropriate MongoDB query, allowing users to query documents by their ObjectId fields using standard MongoDB syntax.
Environment
MCP tools in Cursor/AI assistance environment
Querying a MongoDB database with collections containing ObjectId fields
Impact
This issue significantly impacts the ability to query documents by their IDs, which is a fundamental operation when working with MongoDB.
The text was updated successfully, but these errors were encountered:
App
Affected Models (if applicable)
Bug Description
Title:
ObjectId query syntax fails in MCP tools with "unknown operator: $oid" error
Description:
Problem
When attempting to query documents using ObjectId references in MongoDB MCP tools, queries consistently fail with the error "unknown operator: $oid". This occurs when using standard MongoDB syntax for querying by ObjectId.
Steps to reproduce
Attempt to query a collection using the MCP MongoDB tools
Use a filter containing an ObjectId reference with standard syntax:
Apply to mcp.json
}
Observe the error: "Error running find: unknown operator: $oid"
Failed queries
The following query patterns all produce the same error:
{"_id": {"$oid": "..."}}
{"userId": {"$oid": ""..."}}
{"_id": {"$eq": {"$oid": ""..."}}}
Using the string format without $oid operator does not retrieve documents:
{"_id": ""..."}
Expected behavior
The MCP tools should properly translate the ObjectId query syntax to the appropriate MongoDB query, allowing users to query documents by their ObjectId fields using standard MongoDB syntax.
Environment
MCP tools in Cursor/AI assistance environment
Querying a MongoDB database with collections containing ObjectId fields
Impact
This issue significantly impacts the ability to query documents by their IDs, which is a fundamental operation when working with MongoDB.
The text was updated successfully, but these errors were encountered: