Shortcut for doc lookup by _id

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API, Query Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Very often, we need to simply look up a document by _id. What we have to do is use findOne() and updateOne() with eq("_id", <id value>). Since there's no official constant for "_id" we also have to define our own constant. This seems like something that can be easily provided in an official capacity. Ideally, this would be methods in MongoCollection like findById(<id value>), updateOneById(<id value>, <update>), and so on.

              Assignee:
              Jeffrey Yemin
              Reporter:
              Blake Bauman
              None
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: