Method: BSON::Array#as_extended_json

Defined in:
lib/bson/array.rb

#as_extended_json(**options) ⇒ Array

Converts this object to a representation directly serializable to Extended JSON (github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md).

This method recursively invokes as_extended_json with the provided options on each array element.

Parameters:

  • opts (Hash)

    a customizable set of options

Returns:

  • (Array)

    This array converted to extended json representation.

Since:

  • 2.0.0



104
105
106
107
108
# File 'lib/bson/array.rb', line 104

def as_extended_json(**options)
  map do |item|
    item.as_extended_json(**options)
  end
end