Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-209

Implicit conversion of IEnumerable to BsonArray requested

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • 1.0
    • 1.0
    • Feature Request
    • None

    Description

      It would be nice if an implicit conversion from IEnumerable to BsonArray existed so we could write code like this:

      var values = new int[]

      { 1, 2, 3 }

      ;
      var document = new BsonDocument("array", values);

      instead of:

      var document = new BsonDocument("array", new BsonArray(values));

      NOTE: make sure this implicit conversion doesn't have any undesirable side effects before implementing this request

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: