merge

open fun merge(other: Option): Option(source)

Merges this option with another of the same type.

The caller is responsible for only calling this method with a parameter of the same concrete type as the current instance.

This method returns a new option, which combines the values of both options.

This method must be called in the same order as the options are defined. For example, if a is defined before b, then a.merge(b) is valid, but b.merge(a) is not.

By default, this method returns the last declared option.

This method is called by the option holder's BsonNode.simplify method.