Python Driver
  1. Python Driver
  2. PYTHON-376

Support strict checking of whether a collection exists upon attribute-style access

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor - P4 Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • # Replies:
      1
    • Last comment by Customer:
      false

      Description

      Accessing a collection as db.mycollection.find() can silently fail if there is a typo in the collection name, e.g. db.mycollections.find().

      Allow pymongo to be configured to raise an exception if the collection doesn't exist?

        Activity

        • Comments
        Hide
        Bernie Hackett
        added a comment -

        Adding checking like this to PyMongo would require an extra round trip to the server, impacting performance. It might make sense for the server to return an error about the collection not existing but that would be a ticket against the core server project.

        Show
        Bernie Hackett
        added a comment - Adding checking like this to PyMongo would require an extra round trip to the server, impacting performance. It might make sense for the server to return an error about the collection not existing but that would be a ticket against the core server project.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 40 weeks, 6 days ago
              Date of 1st Reply: