[LangChain] agent_toolkit parser does not handle ObjectId references

XMLWordPrintableJSON

    • None
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      As reported in https://github.com/langchain-ai/langchain-mongodb/issues/163, our parsing logic is expecting a JSON value, so the following gives an error:

       

      Error: ValueError('Cannot execute command db.contracts.aggregate([ { "$match":

      { "contractType1": ObjectId("685ce918a1903cacfd052234") }

      }, { "$project":

      { "contractName": 1, "contract_prefix": 1, "contractStatus": 1, "contractExpiry": 1, "effectiveDate": 1 }

      }, { "$sort":

      { "createdAt": -1 }

      }, { "$limit": 5 } ])')

       

      We should be able to handle ObjectId values in 
      MongoDBDatabase._parse_command, despite our LLM prompt asking for JSON values.

              Assignee:
              Steve Silvester
              Reporter:
              Steve Silvester
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: