Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13851

Wrong example in mongofiles docs page

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      In the examples section of https://docs.mongodb.com/database-tools/mongofiles/:

      To fetch the file from the GridFS collection in the records database with _id: ObjectId("56feac751f417d0357e7140f"), you can use the following command:

      mongofiles -d=records get_id 'ObjectId("56feac751f417d0357e7140f")'

      Running this command resulted in an error:

      Failed: error parsing id as Extended JSON: invalid JSON number. Position: 18
      

      The correct command should be:

      mongofiles -d=test get_id '{"$oid": "56feac751f417d0357e7140f"}'
      

      Note that this incorrect example has caused some confusion in the Developer Forums.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            andrew.feierabend@mongodb.com Andrew Feierabend (Inactive)
            Reporter:
            kevin.adistambha@mongodb.com Kevin Adistambha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              3 years, 32 weeks, 1 day ago