Collection.Clone doesn't copy BSONOptions

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 2.7.0
    • Affects Version/s: 2.5.0
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Go Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Detailed steps to reproduce the problem?

      Create a collection with BSONOptions and clone the collection.

      coll := mt.Client.
      	Database("...").
      	Collection("...", options.Collection().
      		SetBSONOptions(&options.BSONOptions{
      			UseJSONStructTags: true,
      		}),
      	)
      clone := coll.Clone()
      

      When running queries with clone, the UseJSONStructTags config will not be honored.

      Definition of done: what must be done to consider the task complete?

      The exact Go version used, with patch level:

      The exact version of the Go driver used:

      v2.5.0

      Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

      The operating system and version (e.g. Windows 7, OSX 10.8, ...)

      Security Vulnerabilities

      If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here

            Assignee:
            Matt Dale
            Reporter:
            Matt Dale
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: