_id of Document should not have to be of type ObjectId

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      The _id field of the Document type should be of type any, rather exclusively ObjectId when using the driver with TypeScript. In MongoDB, the _id field is required in all documents but can be of many types (ObjectId, string, int, etc.). In TypeScript driver, compiler errors will arise when inserting documents with the _id field set to non-ObjectId types. This then requires odd workarounds, explicitly setting things to the any type.

            Assignee:
            Unassigned
            Reporter:
            Xavier Donnellon
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: