Unexpected and not documented exception in MongoDatabase.CreateCollection(String, IMongoCollectionOptions)

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 1.5
    • Affects Version/s: 1.4.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I am trying to create a collection which already exists (a capped one, if this
      matters). As far as the method returns `CommandResult`, I expect it to return
      an error information (and I write ahead some code that check for `Ok` and uses
      the error message). But instead the method throws an exception.

      I propose either to document this exception (it is not) or, better, to not
      throw but return an error. The latter is more expected and consistent with,
      say, `DropCollection` which does not throw on missing collections but returns
      error information.

              Assignee:
              Robert Stam
              Reporter:
              Roman Kuzmin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: