Prohibit empty seed list in client constructor

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Trivial - P5
    • 3.0.0
    • Affects Version/s: None
    • Component/s: Dev Exp
    • None
    • None
    • None
    • None
    • None
    • None

      The client requires an array of seeds or a URI, but the array can be empty:

      irb(main):001:0> Mongo::Client.new([])
      D, [2018-11-07T14:16:30.258387 #18327] DEBUG -- : MONGODB | EVENT: #<TopologyOpening topology=Unknown[]>
      D, [2018-11-07T14:16:30.258561 #18327] DEBUG -- : MONGODB | Topology type 'unknown' initializing.
      => #<Mongo::Client:0x46962734145360 cluster=#<Cluster topology=Unknown[] servers=[]>>
      

      The result is not very useful.

      The client refusing to instantiate with an empty seed list may catch errors when someone does something like Mongo::Client.new([*seeds]).

            Assignee:
            Unassigned
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: