| 1 | // Copyright (C) MongoDB, Inc. 2017-present. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | // not use this file except in compliance with the License. You may obtain |
| 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | |
| 7 | package bsoncodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ |
| 8 | |
| 9 | import ( |
| 10 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/" |
| 11 | "errorsscip-go gomod github.com/golang/go/src go1.18 errors/" |
| 12 | "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/" |
| 13 | "mathscip-go gomod github.com/golang/go/src go1.18 math/" |
| 14 | "net/urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/" |
| 15 | "reflectscip-go gomod github.com/golang/go/src go1.18 reflect/" |
| 16 | "strconvscip-go gomod github.com/golang/go/src go1.18 strconv/" |
| 17 | "timescip-go gomod github.com/golang/go/src go1.18 time/" |
| 18 | |
| 19 | "go.mongodb.org/mongo-driver/bson/bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/" |
| 20 | "go.mongodb.org/mongo-driver/bson/bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/" |
| 21 | "go.mongodb.org/mongo-driver/bson/primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/" |
| 22 | "go.mongodb.org/mongo-driver/x/bsonx/bsoncorescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/x/bsonx/bsoncore`/" |
| 23 | ) |
| 24 | |
| 25 | var ( |
| 26 | defaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultValueDecoders. DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders# |
| 27 | errCannotTruncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/errCannotTruncate. = errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("float64 can only be truncated to a lower precision type when truncation is enabled") |
| 28 | ) |
| 29 | |
| 30 | type decodeBinaryErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError# struct { |
| 31 | subtypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#subtype. byte |
| 32 | typeNamescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#typeName. string |
| 33 | } |
| 34 | |
| 35 | func (d decodeBinaryErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#) Errorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#Error().() string { |
| 36 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.18 fmt/Sprintf().("only binary values with subtype 0x00 or 0x02 can be decoded into %s, but got subtype %v", d.typeNamescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#typeName., d.subtypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#subtype.) |
| 37 | } |
| 38 | |
| 39 | func newDefaultStructCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/newDefaultStructCodec().() *StructCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/StructCodec# { |
| 40 | codec, err := NewStructCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/NewStructCodec().(DefaultStructTagParserscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultStructTagParser.) |
| 41 | if err != nil { |
| 42 | // This function is called from the codec registration path, so errors can't be propagated. If there's an error |
| 43 | // constructing the StructCodec, we panic to avoid losing it. |
| 44 | panic(fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("error creating default StructCodec: %w", err)) |
| 45 | } |
| 46 | return codec |
| 47 | } |
| 48 | |
| 49 | // DefaultValueDecoders is a namespace type for the default ValueDecoders used |
| 50 | // when creating a registry. |
| 51 | // |
| 52 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 53 | // value decoders registered. |
| 54 | type DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders# struct{} |
| 55 | |
| 56 | // RegisterDefaultDecoders will register the decoder methods attached to DefaultValueDecoders with |
| 57 | // the provided RegistryBuilder. |
| 58 | // |
| 59 | // There is no support for decoding map[string]interface{} because there is no decoder for |
| 60 | // interface{}, so users must either register this decoder themselves or use the |
| 61 | // EmptyInterfaceDecoder available in the bson package. |
| 62 | // |
| 63 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 64 | // value decoders registered. |
| 65 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) RegisterDefaultDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#RegisterDefaultDecoders().(rb *RegistryBuilderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#) { |
| 66 | if rb == nil { |
| 67 | panic(errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("argument to RegisterDefaultDecoders must not be nil")) |
| 68 | } |
| 69 | |
| 70 | intDecoder := decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.IntDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#IntDecodeValue()., dvd.intDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#intDecodeType().} |
| 71 | floatDecoder := decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.FloatDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#FloatDecodeValue()., dvd.floatDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#floatDecodeType().} |
| 72 | |
| 73 | rb. |
| 74 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD., ValueDecoderFuncscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderFunc#(dvd.DDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DDecodeValue().)). |
| 75 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.BinaryDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#BinaryDecodeValue()., dvd.binaryDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#binaryDecodeType().}). |
| 76 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.UndefinedDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#UndefinedDecodeValue()., dvd.undefinedDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#undefinedDecodeType().}). |
| 77 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.DateTimeDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DateTimeDecodeValue()., dvd.dateTimeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dateTimeDecodeType().}). |
| 78 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.NullDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#NullDecodeValue()., dvd.nullDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#nullDecodeType().}). |
| 79 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.RegexDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#RegexDecodeValue()., dvd.regexDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#regexDecodeType().}). |
| 80 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.DBPointerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DBPointerDecodeValue()., dvd.dBPointerDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dBPointerDecodeType().}). |
| 81 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.TimestampDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#TimestampDecodeValue()., dvd.timestampDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#timestampDecodeType().}). |
| 82 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.MinKeyDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#MinKeyDecodeValue()., dvd.minKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#minKeyDecodeType().}). |
| 83 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.MaxKeyDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#MaxKeyDecodeValue()., dvd.maxKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#maxKeyDecodeType().}). |
| 84 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.JavaScriptDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#JavaScriptDecodeValue()., dvd.javaScriptDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#javaScriptDecodeType().}). |
| 85 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.SymbolDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#SymbolDecodeValue()., dvd.symbolDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#symbolDecodeType().}). |
| 86 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tByteSlicescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tByteSlice., defaultByteSliceCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultByteSliceCodec.). |
| 87 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTime., defaultTimeCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultTimeCodec.). |
| 88 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty., defaultEmptyInterfaceCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultEmptyInterfaceCodec.). |
| 89 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tCoreArrayscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCoreArray., defaultArrayCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultArrayCodec.). |
| 90 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.ObjectIDDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ObjectIDDecodeValue()., dvd.objectIDDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#objectIDDecodeType().}). |
| 91 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.Decimal128DecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#Decimal128DecodeValue()., dvd.decimal128DecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decimal128DecodeType().}). |
| 92 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.JSONNumberDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#JSONNumberDecodeValue()., dvd.jsonNumberDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#jsonNumberDecodeType().}). |
| 93 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.URLDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#URLDecodeValue()., dvd.urlDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#urlDecodeType().}). |
| 94 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tCoreDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCoreDocument., ValueDecoderFuncscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderFunc#(dvd.CoreDocumentDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#CoreDocumentDecodeValue().)). |
| 95 | RegisterTypeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeDecoder().(tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.CodeWithScopeDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#CodeWithScopeDecodeValue()., dvd.codeWithScopeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#codeWithScopeDecodeType().}). |
| 96 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Bool., decodeAdapterscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeAdapter#{dvd.BooleanDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#BooleanDecodeValue()., dvd.booleanDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#booleanDecodeType().}). |
| 97 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Intscip-go gomod github.com/golang/go/src go1.18 reflect/Int., intDecoder). |
| 98 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int8scip-go gomod github.com/golang/go/src go1.18 reflect/Int8., intDecoder). |
| 99 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int16scip-go gomod github.com/golang/go/src go1.18 reflect/Int16., intDecoder). |
| 100 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int32scip-go gomod github.com/golang/go/src go1.18 reflect/Int32., intDecoder). |
| 101 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int64scip-go gomod github.com/golang/go/src go1.18 reflect/Int64., intDecoder). |
| 102 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uintscip-go gomod github.com/golang/go/src go1.18 reflect/Uint., defaultUIntCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultUIntCodec.). |
| 103 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.18 reflect/Uint8., defaultUIntCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultUIntCodec.). |
| 104 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint16scip-go gomod github.com/golang/go/src go1.18 reflect/Uint16., defaultUIntCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultUIntCodec.). |
| 105 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint32scip-go gomod github.com/golang/go/src go1.18 reflect/Uint32., defaultUIntCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultUIntCodec.). |
| 106 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint64scip-go gomod github.com/golang/go/src go1.18 reflect/Uint64., defaultUIntCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultUIntCodec.). |
| 107 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float32scip-go gomod github.com/golang/go/src go1.18 reflect/Float32., floatDecoder). |
| 108 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float64scip-go gomod github.com/golang/go/src go1.18 reflect/Float64., floatDecoder). |
| 109 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.18 reflect/Array., ValueDecoderFuncscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderFunc#(dvd.ArrayDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ArrayDecodeValue().)). |
| 110 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Mapscip-go gomod github.com/golang/go/src go1.18 reflect/Map., defaultMapCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultMapCodec.). |
| 111 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Slicescip-go gomod github.com/golang/go/src go1.18 reflect/Slice., defaultSliceCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultSliceCodec.). |
| 112 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/String., defaultStringCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/defaultStringCodec.). |
| 113 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Structscip-go gomod github.com/golang/go/src go1.18 reflect/Struct., newDefaultStructCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/newDefaultStructCodec().()). |
| 114 | RegisterDefaultDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterDefaultDecoder().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr., NewPointerCodecscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/NewPointerCodec().()). |
| 115 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double., tFloat64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tFloat64.). |
| 116 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Stringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/String., tStringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tString.). |
| 117 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Arrayscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Array., tAscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tA.). |
| 118 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary., tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary.). |
| 119 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined., tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined.). |
| 120 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.ObjectIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/ObjectID., tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID.). |
| 121 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Booleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Boolean., tBoolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBool.). |
| 122 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.DateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/DateTime., tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime.). |
| 123 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Regexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Regex., tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex.). |
| 124 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.DBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/DBPointer., tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer.). |
| 125 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.JavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/JavaScript., tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript.). |
| 126 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Symbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Symbol., tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol.). |
| 127 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/CodeWithScope., tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope.). |
| 128 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32., tInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tInt32.). |
| 129 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64., tInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tInt64.). |
| 130 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Timestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Timestamp., tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp.). |
| 131 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Decimal128scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Decimal128., tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal.). |
| 132 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.MinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/MinKey., tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey.). |
| 133 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.MaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/MaxKey., tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey.). |
| 134 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD.). |
| 135 | RegisterTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterTypeMapEntry().(bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument., tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD.). |
| 136 | RegisterHookDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterHookDecoder().(tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler., ValueDecoderFuncscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderFunc#(dvd.ValueUnmarshalerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ValueUnmarshalerDecodeValue().)). |
| 137 | RegisterHookDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/RegistryBuilder#RegisterHookDecoder().(tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler., ValueDecoderFuncscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderFunc#(dvd.UnmarshalerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#UnmarshalerDecodeValue().)) |
| 138 | } |
| 139 | |
| 140 | // DDecodeValue is the ValueDecoderFunc for primitive.D instances. |
| 141 | // |
| 142 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 143 | // value decoders registered. |
| 144 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) DDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 145 | if !val.IsValidscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsValid().() || !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD. { |
| 146 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "DDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Slicescip-go gomod github.com/golang/go/src go1.18 reflect/Slice.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 147 | } |
| 148 | |
| 149 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 150 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 151 | dc.Ancestorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Ancestor. = tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD. |
| 152 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 153 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 154 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 155 | default: |
| 156 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a primitive.D", vrType) |
| 157 | } |
| 158 | |
| 159 | dr, err := vr.ReadDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDocument.() |
| 160 | if err != nil { |
| 161 | return err |
| 162 | } |
| 163 | |
| 164 | decoder, err := dc.LookupDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupDecoder().(tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty.) |
| 165 | if err != nil { |
| 166 | return err |
| 167 | } |
| 168 | tEmptyTypeDecoder, _ := decoder.(typeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/typeDecoder#) |
| 169 | |
| 170 | // Use the elements in the provided value if it's non nil. Otherwise, allocate a new D instance. |
| 171 | var elems primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Dscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/D# |
| 172 | if !val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 173 | val.SetLenscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetLen().(0) |
| 174 | elems = val.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Dscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/D#) |
| 175 | } else { |
| 176 | elems = make(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Dscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/D#, 0) |
| 177 | } |
| 178 | |
| 179 | for { |
| 180 | key, elemVr, err := dr.ReadElementscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/DocumentReader#ReadElement.() |
| 181 | if errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Isscip-go gomod github.com/golang/go/src go1.18 errors/Is().(err, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ErrEODscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ErrEOD.) { |
| 182 | break |
| 183 | } else if err != nil { |
| 184 | return err |
| 185 | } |
| 186 | |
| 187 | // Pass false for convert because we don't need to call reflect.Value.Convert for tEmpty. |
| 188 | elem, err := decodeTypeOrValueWithInfoscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeTypeOrValueWithInfo().(decoder, tEmptyTypeDecoder, dc, elemVr, tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty., false) |
| 189 | if err != nil { |
| 190 | return err |
| 191 | } |
| 192 | |
| 193 | elems = append(elems, primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Escip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#{Keyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#Key.: key, Valuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#Value.: elem.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().()}) |
| 194 | } |
| 195 | |
| 196 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(elems)) |
| 197 | return nil |
| 198 | } |
| 199 | |
| 200 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) booleanDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#booleanDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 201 | if t.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Bool. { |
| 202 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 203 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "BooleanDecodeValue", |
| 204 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Bool.}, |
| 205 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | var b bool |
| 210 | var err error |
| 211 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 212 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32.: |
| 213 | i32, err := vr.ReadInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt32.() |
| 214 | if err != nil { |
| 215 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 216 | } |
| 217 | b = (i32 != 0) |
| 218 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64.: |
| 219 | i64, err := vr.ReadInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt64.() |
| 220 | if err != nil { |
| 221 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 222 | } |
| 223 | b = (i64 != 0) |
| 224 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double.: |
| 225 | f64, err := vr.ReadDoublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDouble.() |
| 226 | if err != nil { |
| 227 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 228 | } |
| 229 | b = (f64 != 0) |
| 230 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Booleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Boolean.: |
| 231 | b, err = vr.ReadBooleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBoolean.() |
| 232 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 233 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 234 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 235 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 236 | default: |
| 237 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a boolean", vrType) |
| 238 | } |
| 239 | if err != nil { |
| 240 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 241 | } |
| 242 | |
| 243 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(b), nil |
| 244 | } |
| 245 | |
| 246 | // BooleanDecodeValue is the ValueDecoderFunc for bool types. |
| 247 | // |
| 248 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 249 | // value decoders registered. |
| 250 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) BooleanDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#BooleanDecodeValue().(dctx DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 251 | if !val.IsValidscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsValid().() || !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Bool. { |
| 252 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "BooleanDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Bool.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 253 | } |
| 254 | |
| 255 | elem, err := dvd.booleanDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#booleanDecodeType().(dctx, vr, val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 256 | if err != nil { |
| 257 | return err |
| 258 | } |
| 259 | |
| 260 | val.SetBoolscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetBool().(elem.Boolscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Bool().()) |
| 261 | return nil |
| 262 | } |
| 263 | |
| 264 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) intDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#intDecodeType().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 265 | var i64 int64 |
| 266 | var err error |
| 267 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 268 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32.: |
| 269 | i32, err := vr.ReadInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt32.() |
| 270 | if err != nil { |
| 271 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 272 | } |
| 273 | i64 = int64(i32) |
| 274 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64.: |
| 275 | i64, err = vr.ReadInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt64.() |
| 276 | if err != nil { |
| 277 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 278 | } |
| 279 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double.: |
| 280 | f64, err := vr.ReadDoublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDouble.() |
| 281 | if err != nil { |
| 282 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 283 | } |
| 284 | if !dc.Truncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Truncate. && mathscip-go gomod github.com/golang/go/src go1.18 math/.Floorscip-go gomod github.com/golang/go/src go1.18 math/Floor().(f64) != f64 { |
| 285 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., errCannotTruncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/errCannotTruncate. |
| 286 | } |
| 287 | if f64 > float64(mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.18 math/MaxInt64.) { |
| 288 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%g overflows int64", f64) |
| 289 | } |
| 290 | i64 = int64(f64) |
| 291 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Booleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Boolean.: |
| 292 | b, err := vr.ReadBooleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBoolean.() |
| 293 | if err != nil { |
| 294 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 295 | } |
| 296 | if b { |
| 297 | i64 = 1 |
| 298 | } |
| 299 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 300 | if err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.(); err != nil { |
| 301 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 302 | } |
| 303 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 304 | if err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.(); err != nil { |
| 305 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 306 | } |
| 307 | default: |
| 308 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into an integer type", vrType) |
| 309 | } |
| 310 | |
| 311 | switch t.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Kind().() { |
| 312 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int8scip-go gomod github.com/golang/go/src go1.18 reflect/Int8.: |
| 313 | if i64 < mathscip-go gomod github.com/golang/go/src go1.18 math/.MinInt8scip-go gomod github.com/golang/go/src go1.18 math/MinInt8. || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxInt8scip-go gomod github.com/golang/go/src go1.18 math/MaxInt8. { |
| 314 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows int8", i64) |
| 315 | } |
| 316 | |
| 317 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(int8(i64)), nil |
| 318 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int16scip-go gomod github.com/golang/go/src go1.18 reflect/Int16.: |
| 319 | if i64 < mathscip-go gomod github.com/golang/go/src go1.18 math/.MinInt16scip-go gomod github.com/golang/go/src go1.18 math/MinInt16. || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxInt16scip-go gomod github.com/golang/go/src go1.18 math/MaxInt16. { |
| 320 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows int16", i64) |
| 321 | } |
| 322 | |
| 323 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(int16(i64)), nil |
| 324 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int32scip-go gomod github.com/golang/go/src go1.18 reflect/Int32.: |
| 325 | if i64 < mathscip-go gomod github.com/golang/go/src go1.18 math/.MinInt32scip-go gomod github.com/golang/go/src go1.18 math/MinInt32. || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxInt32scip-go gomod github.com/golang/go/src go1.18 math/MaxInt32. { |
| 326 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows int32", i64) |
| 327 | } |
| 328 | |
| 329 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(int32(i64)), nil |
| 330 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int64scip-go gomod github.com/golang/go/src go1.18 reflect/Int64.: |
| 331 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(i64), nil |
| 332 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Intscip-go gomod github.com/golang/go/src go1.18 reflect/Int.: |
| 333 | if i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxIntscip-go gomod github.com/golang/go/src go1.18 math/MaxInt. { // Can we fit this inside of an int |
| 334 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows int", i64) |
| 335 | } |
| 336 | |
| 337 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(int(i64)), nil |
| 338 | default: |
| 339 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 340 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "IntDecodeValue", |
| 341 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int8scip-go gomod github.com/golang/go/src go1.18 reflect/Int8., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int16scip-go gomod github.com/golang/go/src go1.18 reflect/Int16., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int32scip-go gomod github.com/golang/go/src go1.18 reflect/Int32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int64scip-go gomod github.com/golang/go/src go1.18 reflect/Int64., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Intscip-go gomod github.com/golang/go/src go1.18 reflect/Int.}, |
| 342 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 343 | } |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | // IntDecodeValue is the ValueDecoderFunc for int types. |
| 348 | // |
| 349 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 350 | // value decoders registered. |
| 351 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) IntDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#IntDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 352 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() { |
| 353 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 354 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "IntDecodeValue", |
| 355 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int8scip-go gomod github.com/golang/go/src go1.18 reflect/Int8., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int16scip-go gomod github.com/golang/go/src go1.18 reflect/Int16., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int32scip-go gomod github.com/golang/go/src go1.18 reflect/Int32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Int64scip-go gomod github.com/golang/go/src go1.18 reflect/Int64., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Intscip-go gomod github.com/golang/go/src go1.18 reflect/Int.}, |
| 356 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val, |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | elem, err := dvd.intDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#intDecodeType().(dc, vr, val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 361 | if err != nil { |
| 362 | return err |
| 363 | } |
| 364 | |
| 365 | val.SetIntscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetInt().(elem.Intscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Int().()) |
| 366 | return nil |
| 367 | } |
| 368 | |
| 369 | // UintDecodeValue is the ValueDecoderFunc for uint types. |
| 370 | // |
| 371 | // Deprecated: UintDecodeValue is not registered by default. Use UintCodec.DecodeValue instead. |
| 372 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) UintDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#UintDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 373 | var i64 int64 |
| 374 | var err error |
| 375 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 376 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32.: |
| 377 | i32, err := vr.ReadInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt32.() |
| 378 | if err != nil { |
| 379 | return err |
| 380 | } |
| 381 | i64 = int64(i32) |
| 382 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64.: |
| 383 | i64, err = vr.ReadInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt64.() |
| 384 | if err != nil { |
| 385 | return err |
| 386 | } |
| 387 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double.: |
| 388 | f64, err := vr.ReadDoublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDouble.() |
| 389 | if err != nil { |
| 390 | return err |
| 391 | } |
| 392 | if !dc.Truncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Truncate. && mathscip-go gomod github.com/golang/go/src go1.18 math/.Floorscip-go gomod github.com/golang/go/src go1.18 math/Floor().(f64) != f64 { |
| 393 | return errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("UintDecodeValue can only truncate float64 to an integer type when truncation is enabled") |
| 394 | } |
| 395 | if f64 > float64(mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.18 math/MaxInt64.) { |
| 396 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%g overflows int64", f64) |
| 397 | } |
| 398 | i64 = int64(f64) |
| 399 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Booleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Boolean.: |
| 400 | b, err := vr.ReadBooleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBoolean.() |
| 401 | if err != nil { |
| 402 | return err |
| 403 | } |
| 404 | if b { |
| 405 | i64 = 1 |
| 406 | } |
| 407 | default: |
| 408 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into an integer type", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 409 | } |
| 410 | |
| 411 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() { |
| 412 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 413 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UintDecodeValue", |
| 414 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.18 reflect/Uint8., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint16scip-go gomod github.com/golang/go/src go1.18 reflect/Uint16., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint32scip-go gomod github.com/golang/go/src go1.18 reflect/Uint32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint64scip-go gomod github.com/golang/go/src go1.18 reflect/Uint64., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uintscip-go gomod github.com/golang/go/src go1.18 reflect/Uint.}, |
| 415 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val, |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | switch val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() { |
| 420 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.18 reflect/Uint8.: |
| 421 | if i64 < 0 || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxUint8scip-go gomod github.com/golang/go/src go1.18 math/MaxUint8. { |
| 422 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows uint8", i64) |
| 423 | } |
| 424 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint16scip-go gomod github.com/golang/go/src go1.18 reflect/Uint16.: |
| 425 | if i64 < 0 || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxUint16scip-go gomod github.com/golang/go/src go1.18 math/MaxUint16. { |
| 426 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows uint16", i64) |
| 427 | } |
| 428 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint32scip-go gomod github.com/golang/go/src go1.18 reflect/Uint32.: |
| 429 | if i64 < 0 || i64 > mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxUint32scip-go gomod github.com/golang/go/src go1.18 math/MaxUint32. { |
| 430 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows uint32", i64) |
| 431 | } |
| 432 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint64scip-go gomod github.com/golang/go/src go1.18 reflect/Uint64.: |
| 433 | if i64 < 0 { |
| 434 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows uint64", i64) |
| 435 | } |
| 436 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uintscip-go gomod github.com/golang/go/src go1.18 reflect/Uint.: |
| 437 | if i64 < 0 || uint64(i64) > uint64(mathscip-go gomod github.com/golang/go/src go1.18 math/.MaxUintscip-go gomod github.com/golang/go/src go1.18 math/MaxUint.) { // Can we fit this inside of an uint |
| 438 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("%d overflows uint", i64) |
| 439 | } |
| 440 | default: |
| 441 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 442 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UintDecodeValue", |
| 443 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint8scip-go gomod github.com/golang/go/src go1.18 reflect/Uint8., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint16scip-go gomod github.com/golang/go/src go1.18 reflect/Uint16., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint32scip-go gomod github.com/golang/go/src go1.18 reflect/Uint32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uint64scip-go gomod github.com/golang/go/src go1.18 reflect/Uint64., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Uintscip-go gomod github.com/golang/go/src go1.18 reflect/Uint.}, |
| 444 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val, |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | val.SetUintscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetUint().(uint64(i64)) |
| 449 | return nil |
| 450 | } |
| 451 | |
| 452 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) floatDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#floatDecodeType().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 453 | var f float64 |
| 454 | var err error |
| 455 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 456 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32.: |
| 457 | i32, err := vr.ReadInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt32.() |
| 458 | if err != nil { |
| 459 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 460 | } |
| 461 | f = float64(i32) |
| 462 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64.: |
| 463 | i64, err := vr.ReadInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt64.() |
| 464 | if err != nil { |
| 465 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 466 | } |
| 467 | f = float64(i64) |
| 468 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double.: |
| 469 | f, err = vr.ReadDoublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDouble.() |
| 470 | if err != nil { |
| 471 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 472 | } |
| 473 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Booleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Boolean.: |
| 474 | b, err := vr.ReadBooleanscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBoolean.() |
| 475 | if err != nil { |
| 476 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 477 | } |
| 478 | if b { |
| 479 | f = 1 |
| 480 | } |
| 481 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 482 | if err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.(); err != nil { |
| 483 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 484 | } |
| 485 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 486 | if err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.(); err != nil { |
| 487 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 488 | } |
| 489 | default: |
| 490 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a float32 or float64 type", vrType) |
| 491 | } |
| 492 | |
| 493 | switch t.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Kind().() { |
| 494 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float32scip-go gomod github.com/golang/go/src go1.18 reflect/Float32.: |
| 495 | if !dc.Truncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Truncate. && float64(float32(f)) != f { |
| 496 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., errCannotTruncatescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/errCannotTruncate. |
| 497 | } |
| 498 | |
| 499 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(float32(f)), nil |
| 500 | case reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float64scip-go gomod github.com/golang/go/src go1.18 reflect/Float64.: |
| 501 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(f), nil |
| 502 | default: |
| 503 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 504 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "FloatDecodeValue", |
| 505 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float32scip-go gomod github.com/golang/go/src go1.18 reflect/Float32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float64scip-go gomod github.com/golang/go/src go1.18 reflect/Float64.}, |
| 506 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | // FloatDecodeValue is the ValueDecoderFunc for float types. |
| 512 | // |
| 513 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 514 | // value decoders registered. |
| 515 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) FloatDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#FloatDecodeValue().(ec DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 516 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() { |
| 517 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 518 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "FloatDecodeValue", |
| 519 | Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float32scip-go gomod github.com/golang/go/src go1.18 reflect/Float32., reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Float64scip-go gomod github.com/golang/go/src go1.18 reflect/Float64.}, |
| 520 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val, |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | elem, err := dvd.floatDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#floatDecodeType().(ec, vr, val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 525 | if err != nil { |
| 526 | return err |
| 527 | } |
| 528 | |
| 529 | val.SetFloatscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetFloat().(elem.Floatscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Float().()) |
| 530 | return nil |
| 531 | } |
| 532 | |
| 533 | // StringDecodeValue is the ValueDecoderFunc for string types. |
| 534 | // |
| 535 | // Deprecated: StringDecodeValue is not registered by default. Use StringCodec.DecodeValue instead. |
| 536 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) StringDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#StringDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 537 | var str string |
| 538 | var err error |
| 539 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 540 | // TODO(GODRIVER-577): Handle JavaScript and Symbol BSON types when allowed. |
| 541 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Stringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/String.: |
| 542 | str, err = vr.ReadStringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadString.() |
| 543 | if err != nil { |
| 544 | return err |
| 545 | } |
| 546 | default: |
| 547 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a string type", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 548 | } |
| 549 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/String. { |
| 550 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "StringDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/String.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 551 | } |
| 552 | |
| 553 | val.SetStringscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetString().(str) |
| 554 | return nil |
| 555 | } |
| 556 | |
| 557 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) javaScriptDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#javaScriptDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 558 | if t != tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript. { |
| 559 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 560 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "JavaScriptDecodeValue", |
| 561 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript.}, |
| 562 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | var js string |
| 567 | var err error |
| 568 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 569 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.JavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/JavaScript.: |
| 570 | js, err = vr.ReadJavascriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadJavascript.() |
| 571 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 572 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 573 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 574 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 575 | default: |
| 576 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a primitive.JavaScript", vrType) |
| 577 | } |
| 578 | if err != nil { |
| 579 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 580 | } |
| 581 | |
| 582 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.JavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/JavaScript#(js)), nil |
| 583 | } |
| 584 | |
| 585 | // JavaScriptDecodeValue is the ValueDecoderFunc for the primitive.JavaScript type. |
| 586 | // |
| 587 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 588 | // value decoders registered. |
| 589 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) JavaScriptDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#JavaScriptDecodeValue().(dctx DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 590 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript. { |
| 591 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "JavaScriptDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 592 | } |
| 593 | |
| 594 | elem, err := dvd.javaScriptDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#javaScriptDecodeType().(dctx, vr, tJavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJavaScript.) |
| 595 | if err != nil { |
| 596 | return err |
| 597 | } |
| 598 | |
| 599 | val.SetStringscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetString().(elem.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/Value#String().()) |
| 600 | return nil |
| 601 | } |
| 602 | |
| 603 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) symbolDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#symbolDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 604 | if t != tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol. { |
| 605 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 606 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "SymbolDecodeValue", |
| 607 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol.}, |
| 608 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | var symbol string |
| 613 | var err error |
| 614 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 615 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Stringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/String.: |
| 616 | symbol, err = vr.ReadStringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadString.() |
| 617 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Symbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Symbol.: |
| 618 | symbol, err = vr.ReadSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadSymbol.() |
| 619 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary.: |
| 620 | data, subtype, err := vr.ReadBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBinary.() |
| 621 | if err != nil { |
| 622 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 623 | } |
| 624 | |
| 625 | if subtype != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.BinaryGenericscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/BinaryGeneric. && subtype != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.BinaryBinaryOldscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/BinaryBinaryOld. { |
| 626 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., decodeBinaryErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#{subtypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#subtype.: subtype, typeNamescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeBinaryError#typeName.: "primitive.Symbol"} |
| 627 | } |
| 628 | symbol = string(data) |
| 629 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 630 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 631 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 632 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 633 | default: |
| 634 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a primitive.Symbol", vrType) |
| 635 | } |
| 636 | if err != nil { |
| 637 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 638 | } |
| 639 | |
| 640 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Symbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Symbol#(symbol)), nil |
| 641 | } |
| 642 | |
| 643 | // SymbolDecodeValue is the ValueDecoderFunc for the primitive.Symbol type. |
| 644 | // |
| 645 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 646 | // value decoders registered. |
| 647 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) SymbolDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#SymbolDecodeValue().(dctx DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 648 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol. { |
| 649 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "SymbolDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 650 | } |
| 651 | |
| 652 | elem, err := dvd.symbolDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#symbolDecodeType().(dctx, vr, tSymbolscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tSymbol.) |
| 653 | if err != nil { |
| 654 | return err |
| 655 | } |
| 656 | |
| 657 | val.SetStringscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetString().(elem.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/Value#String().()) |
| 658 | return nil |
| 659 | } |
| 660 | |
| 661 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) binaryDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#binaryDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 662 | if t != tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary. { |
| 663 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 664 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "BinaryDecodeValue", |
| 665 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary.}, |
| 666 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | var data []byte |
| 671 | var subtype byte |
| 672 | var err error |
| 673 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 674 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary.: |
| 675 | data, subtype, err = vr.ReadBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBinary.() |
| 676 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 677 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 678 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 679 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 680 | default: |
| 681 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a Binary", vrType) |
| 682 | } |
| 683 | if err != nil { |
| 684 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 685 | } |
| 686 | |
| 687 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Binary#{Subtypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Binary#Subtype.: subtype, Datascip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Binary#Data.: data}), nil |
| 688 | } |
| 689 | |
| 690 | // BinaryDecodeValue is the ValueDecoderFunc for Binary. |
| 691 | // |
| 692 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 693 | // value decoders registered. |
| 694 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) BinaryDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#BinaryDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 695 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary. { |
| 696 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "BinaryDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 697 | } |
| 698 | |
| 699 | elem, err := dvd.binaryDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#binaryDecodeType().(dc, vr, tBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tBinary.) |
| 700 | if err != nil { |
| 701 | return err |
| 702 | } |
| 703 | |
| 704 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 705 | return nil |
| 706 | } |
| 707 | |
| 708 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) undefinedDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#undefinedDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 709 | if t != tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined. { |
| 710 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 711 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UndefinedDecodeValue", |
| 712 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined.}, |
| 713 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | var err error |
| 718 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 719 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 720 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 721 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 722 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 723 | default: |
| 724 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into an Undefined", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 725 | } |
| 726 | if err != nil { |
| 727 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 728 | } |
| 729 | |
| 730 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Undefined#{}), nil |
| 731 | } |
| 732 | |
| 733 | // UndefinedDecodeValue is the ValueDecoderFunc for Undefined. |
| 734 | // |
| 735 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 736 | // value decoders registered. |
| 737 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) UndefinedDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#UndefinedDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 738 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined. { |
| 739 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UndefinedDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 740 | } |
| 741 | |
| 742 | elem, err := dvd.undefinedDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#undefinedDecodeType().(dc, vr, tUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUndefined.) |
| 743 | if err != nil { |
| 744 | return err |
| 745 | } |
| 746 | |
| 747 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 748 | return nil |
| 749 | } |
| 750 | |
| 751 | // Accept both 12-byte string and pretty-printed 24-byte hex string formats. |
| 752 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) objectIDDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#objectIDDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 753 | if t != tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID. { |
| 754 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 755 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ObjectIDDecodeValue", |
| 756 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID.}, |
| 757 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | var oid primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.ObjectIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/ObjectID# |
| 762 | var err error |
| 763 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 764 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.ObjectIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/ObjectID.: |
| 765 | oid, err = vr.ReadObjectIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadObjectID.() |
| 766 | if err != nil { |
| 767 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 768 | } |
| 769 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Stringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/String.: |
| 770 | str, err := vr.ReadStringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadString.() |
| 771 | if err != nil { |
| 772 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 773 | } |
| 774 | if oid, err = primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.ObjectIDFromHexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/ObjectIDFromHex().(str); err == nil { |
| 775 | break |
| 776 | } |
| 777 | if len(str) != 12 { |
| 778 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("an ObjectID string must be exactly 12 bytes long (got %v)", len(str)) |
| 779 | } |
| 780 | byteArr := []byte(str) |
| 781 | copy(oid[:], byteArr) |
| 782 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 783 | if err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.(); err != nil { |
| 784 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 785 | } |
| 786 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 787 | if err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.(); err != nil { |
| 788 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 789 | } |
| 790 | default: |
| 791 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into an ObjectID", vrType) |
| 792 | } |
| 793 | |
| 794 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(oid), nil |
| 795 | } |
| 796 | |
| 797 | // ObjectIDDecodeValue is the ValueDecoderFunc for primitive.ObjectID. |
| 798 | // |
| 799 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 800 | // value decoders registered. |
| 801 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) ObjectIDDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ObjectIDDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 802 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID. { |
| 803 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ObjectIDDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 804 | } |
| 805 | |
| 806 | elem, err := dvd.objectIDDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#objectIDDecodeType().(dc, vr, tOIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tOID.) |
| 807 | if err != nil { |
| 808 | return err |
| 809 | } |
| 810 | |
| 811 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 812 | return nil |
| 813 | } |
| 814 | |
| 815 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) dateTimeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dateTimeDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 816 | if t != tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime. { |
| 817 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 818 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "DateTimeDecodeValue", |
| 819 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime.}, |
| 820 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | var dt int64 |
| 825 | var err error |
| 826 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 827 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.DateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/DateTime.: |
| 828 | dt, err = vr.ReadDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDateTime.() |
| 829 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 830 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 831 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 832 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 833 | default: |
| 834 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a DateTime", vrType) |
| 835 | } |
| 836 | if err != nil { |
| 837 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 838 | } |
| 839 | |
| 840 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.DateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/DateTime#(dt)), nil |
| 841 | } |
| 842 | |
| 843 | // DateTimeDecodeValue is the ValueDecoderFunc for DateTime. |
| 844 | // |
| 845 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 846 | // value decoders registered. |
| 847 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) DateTimeDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DateTimeDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 848 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime. { |
| 849 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "DateTimeDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 850 | } |
| 851 | |
| 852 | elem, err := dvd.dateTimeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dateTimeDecodeType().(dc, vr, tDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDateTime.) |
| 853 | if err != nil { |
| 854 | return err |
| 855 | } |
| 856 | |
| 857 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 858 | return nil |
| 859 | } |
| 860 | |
| 861 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) nullDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#nullDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 862 | if t != tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull. { |
| 863 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 864 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "NullDecodeValue", |
| 865 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull.}, |
| 866 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | var err error |
| 871 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 872 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 873 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 874 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 875 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 876 | default: |
| 877 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a Null", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 878 | } |
| 879 | if err != nil { |
| 880 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 881 | } |
| 882 | |
| 883 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Null#{}), nil |
| 884 | } |
| 885 | |
| 886 | // NullDecodeValue is the ValueDecoderFunc for Null. |
| 887 | // |
| 888 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 889 | // value decoders registered. |
| 890 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) NullDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#NullDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 891 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull. { |
| 892 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "NullDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 893 | } |
| 894 | |
| 895 | elem, err := dvd.nullDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#nullDecodeType().(dc, vr, tNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tNull.) |
| 896 | if err != nil { |
| 897 | return err |
| 898 | } |
| 899 | |
| 900 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 901 | return nil |
| 902 | } |
| 903 | |
| 904 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) regexDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#regexDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 905 | if t != tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex. { |
| 906 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 907 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "RegexDecodeValue", |
| 908 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex.}, |
| 909 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | var pattern, options string |
| 914 | var err error |
| 915 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 916 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Regexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Regex.: |
| 917 | pattern, options, err = vr.ReadRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadRegex.() |
| 918 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 919 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 920 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 921 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 922 | default: |
| 923 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a Regex", vrType) |
| 924 | } |
| 925 | if err != nil { |
| 926 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 927 | } |
| 928 | |
| 929 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Regexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Regex#{Patternscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Regex#Pattern.: pattern, Optionsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Regex#Options.: options}), nil |
| 930 | } |
| 931 | |
| 932 | // RegexDecodeValue is the ValueDecoderFunc for Regex. |
| 933 | // |
| 934 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 935 | // value decoders registered. |
| 936 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) RegexDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#RegexDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 937 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex. { |
| 938 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "RegexDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 939 | } |
| 940 | |
| 941 | elem, err := dvd.regexDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#regexDecodeType().(dc, vr, tRegexscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tRegex.) |
| 942 | if err != nil { |
| 943 | return err |
| 944 | } |
| 945 | |
| 946 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 947 | return nil |
| 948 | } |
| 949 | |
| 950 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) dBPointerDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dBPointerDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 951 | if t != tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer. { |
| 952 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 953 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "DBPointerDecodeValue", |
| 954 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer.}, |
| 955 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | var ns string |
| 960 | var pointer primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.ObjectIDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/ObjectID# |
| 961 | var err error |
| 962 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 963 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.DBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/DBPointer.: |
| 964 | ns, pointer, err = vr.ReadDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDBPointer.() |
| 965 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 966 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 967 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 968 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 969 | default: |
| 970 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a DBPointer", vrType) |
| 971 | } |
| 972 | if err != nil { |
| 973 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 974 | } |
| 975 | |
| 976 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.DBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/DBPointer#{DBscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/DBPointer#DB.: ns, Pointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/DBPointer#Pointer.: pointer}), nil |
| 977 | } |
| 978 | |
| 979 | // DBPointerDecodeValue is the ValueDecoderFunc for DBPointer. |
| 980 | // |
| 981 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 982 | // value decoders registered. |
| 983 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) DBPointerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#DBPointerDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 984 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer. { |
| 985 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "DBPointerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 986 | } |
| 987 | |
| 988 | elem, err := dvd.dBPointerDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#dBPointerDecodeType().(dc, vr, tDBPointerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDBPointer.) |
| 989 | if err != nil { |
| 990 | return err |
| 991 | } |
| 992 | |
| 993 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 994 | return nil |
| 995 | } |
| 996 | |
| 997 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) timestampDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#timestampDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, reflectType reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 998 | if reflectType != tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp. { |
| 999 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1000 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "TimestampDecodeValue", |
| 1001 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp.}, |
| 1002 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(reflectType), |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | var t, incr uint32 |
| 1007 | var err error |
| 1008 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1009 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Timestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Timestamp.: |
| 1010 | t, incr, err = vr.ReadTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadTimestamp.() |
| 1011 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1012 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1013 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1014 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1015 | default: |
| 1016 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a Timestamp", vrType) |
| 1017 | } |
| 1018 | if err != nil { |
| 1019 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1020 | } |
| 1021 | |
| 1022 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Timestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Timestamp#{Tscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Timestamp#T.: t, Iscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Timestamp#I.: incr}), nil |
| 1023 | } |
| 1024 | |
| 1025 | // TimestampDecodeValue is the ValueDecoderFunc for Timestamp. |
| 1026 | // |
| 1027 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1028 | // value decoders registered. |
| 1029 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) TimestampDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#TimestampDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1030 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp. { |
| 1031 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "TimestampDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1032 | } |
| 1033 | |
| 1034 | elem, err := dvd.timestampDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#timestampDecodeType().(dc, vr, tTimestampscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTimestamp.) |
| 1035 | if err != nil { |
| 1036 | return err |
| 1037 | } |
| 1038 | |
| 1039 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1040 | return nil |
| 1041 | } |
| 1042 | |
| 1043 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) minKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#minKeyDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1044 | if t != tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey. { |
| 1045 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1046 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "MinKeyDecodeValue", |
| 1047 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey.}, |
| 1048 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | var err error |
| 1053 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1054 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.MinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/MinKey.: |
| 1055 | err = vr.ReadMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadMinKey.() |
| 1056 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1057 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1058 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1059 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1060 | default: |
| 1061 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a MinKey", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1062 | } |
| 1063 | if err != nil { |
| 1064 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1065 | } |
| 1066 | |
| 1067 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.MinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/MinKey#{}), nil |
| 1068 | } |
| 1069 | |
| 1070 | // MinKeyDecodeValue is the ValueDecoderFunc for MinKey. |
| 1071 | // |
| 1072 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1073 | // value decoders registered. |
| 1074 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) MinKeyDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#MinKeyDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1075 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey. { |
| 1076 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "MinKeyDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1077 | } |
| 1078 | |
| 1079 | elem, err := dvd.minKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#minKeyDecodeType().(dc, vr, tMinKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMinKey.) |
| 1080 | if err != nil { |
| 1081 | return err |
| 1082 | } |
| 1083 | |
| 1084 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1085 | return nil |
| 1086 | } |
| 1087 | |
| 1088 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) maxKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#maxKeyDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1089 | if t != tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey. { |
| 1090 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1091 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "MaxKeyDecodeValue", |
| 1092 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey.}, |
| 1093 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | var err error |
| 1098 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1099 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.MaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/MaxKey.: |
| 1100 | err = vr.ReadMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadMaxKey.() |
| 1101 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1102 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1103 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1104 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1105 | default: |
| 1106 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a MaxKey", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1107 | } |
| 1108 | if err != nil { |
| 1109 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1110 | } |
| 1111 | |
| 1112 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.MaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/MaxKey#{}), nil |
| 1113 | } |
| 1114 | |
| 1115 | // MaxKeyDecodeValue is the ValueDecoderFunc for MaxKey. |
| 1116 | // |
| 1117 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1118 | // value decoders registered. |
| 1119 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) MaxKeyDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#MaxKeyDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1120 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey. { |
| 1121 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "MaxKeyDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1122 | } |
| 1123 | |
| 1124 | elem, err := dvd.maxKeyDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#maxKeyDecodeType().(dc, vr, tMaxKeyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tMaxKey.) |
| 1125 | if err != nil { |
| 1126 | return err |
| 1127 | } |
| 1128 | |
| 1129 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1130 | return nil |
| 1131 | } |
| 1132 | |
| 1133 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) decimal128DecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decimal128DecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1134 | if t != tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal. { |
| 1135 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1136 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "Decimal128DecodeValue", |
| 1137 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal.}, |
| 1138 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1139 | } |
| 1140 | } |
| 1141 | |
| 1142 | var d128 primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Decimal128scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/Decimal128# |
| 1143 | var err error |
| 1144 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1145 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Decimal128scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Decimal128.: |
| 1146 | d128, err = vr.ReadDecimal128scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDecimal128.() |
| 1147 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1148 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1149 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1150 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1151 | default: |
| 1152 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a primitive.Decimal128", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1153 | } |
| 1154 | if err != nil { |
| 1155 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1156 | } |
| 1157 | |
| 1158 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(d128), nil |
| 1159 | } |
| 1160 | |
| 1161 | // Decimal128DecodeValue is the ValueDecoderFunc for primitive.Decimal128. |
| 1162 | // |
| 1163 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1164 | // value decoders registered. |
| 1165 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) Decimal128DecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#Decimal128DecodeValue().(dctx DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1166 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal. { |
| 1167 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "Decimal128DecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1168 | } |
| 1169 | |
| 1170 | elem, err := dvd.decimal128DecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decimal128DecodeType().(dctx, vr, tDecimalscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tDecimal.) |
| 1171 | if err != nil { |
| 1172 | return err |
| 1173 | } |
| 1174 | |
| 1175 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1176 | return nil |
| 1177 | } |
| 1178 | |
| 1179 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) jsonNumberDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#jsonNumberDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1180 | if t != tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber. { |
| 1181 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1182 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "JSONNumberDecodeValue", |
| 1183 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber.}, |
| 1184 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1185 | } |
| 1186 | } |
| 1187 | |
| 1188 | var jsonNum jsonscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/.Numberscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/Number# |
| 1189 | var err error |
| 1190 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1191 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Doublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Double.: |
| 1192 | f64, err := vr.ReadDoublescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDouble.() |
| 1193 | if err != nil { |
| 1194 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1195 | } |
| 1196 | jsonNum = jsonscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/.Numberscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/Number#(strconvscip-go gomod github.com/golang/go/src go1.18 strconv/.FormatFloatscip-go gomod github.com/golang/go/src go1.18 strconv/FormatFloat().(f64, 'f', -1, 64)) |
| 1197 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int32.: |
| 1198 | i32, err := vr.ReadInt32scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt32.() |
| 1199 | if err != nil { |
| 1200 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1201 | } |
| 1202 | jsonNum = jsonscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/.Numberscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/Number#(strconvscip-go gomod github.com/golang/go/src go1.18 strconv/.FormatIntscip-go gomod github.com/golang/go/src go1.18 strconv/FormatInt().(int64(i32), 10)) |
| 1203 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Int64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Int64.: |
| 1204 | i64, err := vr.ReadInt64scip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadInt64.() |
| 1205 | if err != nil { |
| 1206 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1207 | } |
| 1208 | jsonNum = jsonscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/.Numberscip-go gomod github.com/golang/go/src go1.18 `encoding/json`/Number#(strconvscip-go gomod github.com/golang/go/src go1.18 strconv/.FormatIntscip-go gomod github.com/golang/go/src go1.18 strconv/FormatInt().(i64, 10)) |
| 1209 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1210 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1211 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1212 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1213 | default: |
| 1214 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a json.Number", vrType) |
| 1215 | } |
| 1216 | if err != nil { |
| 1217 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1218 | } |
| 1219 | |
| 1220 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(jsonNum), nil |
| 1221 | } |
| 1222 | |
| 1223 | // JSONNumberDecodeValue is the ValueDecoderFunc for json.Number. |
| 1224 | // |
| 1225 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1226 | // value decoders registered. |
| 1227 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) JSONNumberDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#JSONNumberDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1228 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber. { |
| 1229 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "JSONNumberDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1230 | } |
| 1231 | |
| 1232 | elem, err := dvd.jsonNumberDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#jsonNumberDecodeType().(dc, vr, tJSONNumberscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tJSONNumber.) |
| 1233 | if err != nil { |
| 1234 | return err |
| 1235 | } |
| 1236 | |
| 1237 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1238 | return nil |
| 1239 | } |
| 1240 | |
| 1241 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) urlDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#urlDecodeType().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1242 | if t != tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL. { |
| 1243 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1244 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "URLDecodeValue", |
| 1245 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL.}, |
| 1246 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1247 | } |
| 1248 | } |
| 1249 | |
| 1250 | urlPtr := &urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.URLscip-go gomod github.com/golang/go/src go1.18 `net/url`/URL#{} |
| 1251 | var err error |
| 1252 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1253 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Stringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/String.: |
| 1254 | var str string // Declare str here to avoid shadowing err during the ReadString call. |
| 1255 | str, err = vr.ReadStringscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadString.() |
| 1256 | if err != nil { |
| 1257 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1258 | } |
| 1259 | |
| 1260 | urlPtr, err = urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Parsescip-go gomod github.com/golang/go/src go1.18 `net/url`/Parse().(str) |
| 1261 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1262 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1263 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1264 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1265 | default: |
| 1266 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a *url.URL", vrType) |
| 1267 | } |
| 1268 | if err != nil { |
| 1269 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1270 | } |
| 1271 | |
| 1272 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(urlPtr).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().(), nil |
| 1273 | } |
| 1274 | |
| 1275 | // URLDecodeValue is the ValueDecoderFunc for url.URL. |
| 1276 | // |
| 1277 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1278 | // value decoders registered. |
| 1279 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) URLDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#URLDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1280 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL. { |
| 1281 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "URLDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1282 | } |
| 1283 | |
| 1284 | elem, err := dvd.urlDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#urlDecodeType().(dc, vr, tURLscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tURL.) |
| 1285 | if err != nil { |
| 1286 | return err |
| 1287 | } |
| 1288 | |
| 1289 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1290 | return nil |
| 1291 | } |
| 1292 | |
| 1293 | // TimeDecodeValue is the ValueDecoderFunc for time.Time. |
| 1294 | // |
| 1295 | // Deprecated: TimeDecodeValue is not registered by default. Use TimeCodec.DecodeValue instead. |
| 1296 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) TimeDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#TimeDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1297 | if vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.DateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/DateTime. { |
| 1298 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a time.Time", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1299 | } |
| 1300 | |
| 1301 | dt, err := vr.ReadDateTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDateTime.() |
| 1302 | if err != nil { |
| 1303 | return err |
| 1304 | } |
| 1305 | |
| 1306 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTime. { |
| 1307 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "TimeDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tTimescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tTime.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1308 | } |
| 1309 | |
| 1310 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(timescip-go gomod github.com/golang/go/src go1.18 time/.Unixscip-go gomod github.com/golang/go/src go1.18 time/Unix().(dt/1000, dt%1000*1000000).UTCscip-go gomod github.com/golang/go/src go1.18 time/Time#UTC().())) |
| 1311 | return nil |
| 1312 | } |
| 1313 | |
| 1314 | // ByteSliceDecodeValue is the ValueDecoderFunc for []byte. |
| 1315 | // |
| 1316 | // Deprecated: ByteSliceDecodeValue is not registered by default. Use ByteSliceCodec.DecodeValue instead. |
| 1317 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) ByteSliceDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ByteSliceDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1318 | if vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary. && vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null. { |
| 1319 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a []byte", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1320 | } |
| 1321 | |
| 1322 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tByteSlicescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tByteSlice. { |
| 1323 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ByteSliceDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tByteSlicescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tByteSlice.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1324 | } |
| 1325 | |
| 1326 | if vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() == bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null. { |
| 1327 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1328 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1329 | } |
| 1330 | |
| 1331 | data, subtype, err := vr.ReadBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBinary.() |
| 1332 | if err != nil { |
| 1333 | return err |
| 1334 | } |
| 1335 | if subtype != 0x00 { |
| 1336 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("ByteSliceDecodeValue can only be used to decode subtype 0x00 for %s, got %v", bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary., subtype) |
| 1337 | } |
| 1338 | |
| 1339 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(data)) |
| 1340 | return nil |
| 1341 | } |
| 1342 | |
| 1343 | // MapDecodeValue is the ValueDecoderFunc for map[string]* types. |
| 1344 | // |
| 1345 | // Deprecated: MapDecodeValue is not registered by default. Use MapCodec.DecodeValue instead. |
| 1346 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) MapDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#MapDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1347 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Mapscip-go gomod github.com/golang/go/src go1.18 reflect/Map. || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Keyscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Key().().Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Stringscip-go gomod github.com/golang/go/src go1.18 reflect/String. { |
| 1348 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "MapDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Mapscip-go gomod github.com/golang/go/src go1.18 reflect/Map.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1349 | } |
| 1350 | |
| 1351 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 1352 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 1353 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1354 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1355 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1356 | default: |
| 1357 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a %s", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(), val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 1358 | } |
| 1359 | |
| 1360 | dr, err := vr.ReadDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDocument.() |
| 1361 | if err != nil { |
| 1362 | return err |
| 1363 | } |
| 1364 | |
| 1365 | if val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 1366 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.MakeMapscip-go gomod github.com/golang/go/src go1.18 reflect/MakeMap().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1367 | } |
| 1368 | |
| 1369 | eType := val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() |
| 1370 | decoder, err := dc.LookupDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupDecoder().(eType) |
| 1371 | if err != nil { |
| 1372 | return err |
| 1373 | } |
| 1374 | |
| 1375 | if eType == tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty. { |
| 1376 | dc.Ancestorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Ancestor. = val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() |
| 1377 | } |
| 1378 | |
| 1379 | keyType := val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Keyscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Key().() |
| 1380 | for { |
| 1381 | key, vr, err := dr.ReadElementscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/DocumentReader#ReadElement.() |
| 1382 | if errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Isscip-go gomod github.com/golang/go/src go1.18 errors/Is().(err, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ErrEODscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ErrEOD.) { |
| 1383 | break |
| 1384 | } |
| 1385 | if err != nil { |
| 1386 | return err |
| 1387 | } |
| 1388 | |
| 1389 | elem := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(eType).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().() |
| 1390 | |
| 1391 | err = decoder.DecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoder#DecodeValue.(dc, vr, elem) |
| 1392 | if err != nil { |
| 1393 | return err |
| 1394 | } |
| 1395 | |
| 1396 | val.SetMapIndexscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetMapIndex().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(key).Convertscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Convert().(keyType), elem) |
| 1397 | } |
| 1398 | return nil |
| 1399 | } |
| 1400 | |
| 1401 | // ArrayDecodeValue is the ValueDecoderFunc for array types. |
| 1402 | // |
| 1403 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1404 | // value decoders registered. |
| 1405 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) ArrayDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ArrayDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1406 | if !val.IsValidscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsValid().() || val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.18 reflect/Array. { |
| 1407 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ArrayDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.18 reflect/Array.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1408 | } |
| 1409 | |
| 1410 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1411 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Arrayscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Array.: |
| 1412 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 1413 | if val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() != tEscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tE. { |
| 1414 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode document into %s", val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 1415 | } |
| 1416 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary.: |
| 1417 | if val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() != tBytescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tByte. { |
| 1418 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("ArrayDecodeValue can only be used to decode binary into a byte array, got %v", vrType) |
| 1419 | } |
| 1420 | data, subtype, err := vr.ReadBinaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadBinary.() |
| 1421 | if err != nil { |
| 1422 | return err |
| 1423 | } |
| 1424 | if subtype != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.BinaryGenericscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/BinaryGeneric. && subtype != bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.BinaryBinaryOldscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/BinaryBinaryOld. { |
| 1425 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("ArrayDecodeValue can only be used to decode subtype 0x00 or 0x02 for %s, got %v", bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Binaryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Binary., subtype) |
| 1426 | } |
| 1427 | |
| 1428 | if len(data) > val.Lenscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Len().() { |
| 1429 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("more elements returned in array than can fit inside %s", val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 1430 | } |
| 1431 | |
| 1432 | for idx, elem := range data { |
| 1433 | val.Indexscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Index().(idx).Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(elem)) |
| 1434 | } |
| 1435 | return nil |
| 1436 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1437 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1438 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1439 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1440 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1441 | return vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1442 | default: |
| 1443 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into an array", vrType) |
| 1444 | } |
| 1445 | |
| 1446 | var elemsFunc func(DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) ([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) |
| 1447 | switch val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() { |
| 1448 | case tEscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tE.: |
| 1449 | elemsFunc = dvd.decodeDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeD(). |
| 1450 | default: |
| 1451 | elemsFunc = dvd.decodeDefaultscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeDefault(). |
| 1452 | } |
| 1453 | |
| 1454 | elems, err := elemsFunc(dc, vr, val) |
| 1455 | if err != nil { |
| 1456 | return err |
| 1457 | } |
| 1458 | |
| 1459 | if len(elems) > val.Lenscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Len().() { |
| 1460 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("more elements returned in array than can fit inside %s, got %v elements", val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().(), len(elems)) |
| 1461 | } |
| 1462 | |
| 1463 | for idx, elem := range elems { |
| 1464 | val.Indexscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Index().(idx).Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1465 | } |
| 1466 | |
| 1467 | return nil |
| 1468 | } |
| 1469 | |
| 1470 | // SliceDecodeValue is the ValueDecoderFunc for slice types. |
| 1471 | // |
| 1472 | // Deprecated: SliceDecodeValue is not registered by default. Use SliceCodec.DecodeValue instead. |
| 1473 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) SliceDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#SliceDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1474 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Slicescip-go gomod github.com/golang/go/src go1.18 reflect/Slice. { |
| 1475 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "SliceDecodeValue", Kindsscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Kinds.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Kind#{reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Slicescip-go gomod github.com/golang/go/src go1.18 reflect/Slice.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1476 | } |
| 1477 | |
| 1478 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 1479 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Arrayscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Array.: |
| 1480 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1481 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1482 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1483 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 1484 | if val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() != tEscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tE. { |
| 1485 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode document into %s", val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()) |
| 1486 | } |
| 1487 | default: |
| 1488 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a slice", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1489 | } |
| 1490 | |
| 1491 | var elemsFunc func(DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) ([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) |
| 1492 | switch val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() { |
| 1493 | case tEscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tE.: |
| 1494 | dc.Ancestorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Ancestor. = val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() |
| 1495 | elemsFunc = dvd.decodeDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeD(). |
| 1496 | default: |
| 1497 | elemsFunc = dvd.decodeDefaultscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeDefault(). |
| 1498 | } |
| 1499 | |
| 1500 | elems, err := elemsFunc(dc, vr, val) |
| 1501 | if err != nil { |
| 1502 | return err |
| 1503 | } |
| 1504 | |
| 1505 | if val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 1506 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.MakeSlicescip-go gomod github.com/golang/go/src go1.18 reflect/MakeSlice().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().(), 0, len(elems))) |
| 1507 | } |
| 1508 | |
| 1509 | val.SetLenscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetLen().(0) |
| 1510 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Appendscip-go gomod github.com/golang/go/src go1.18 reflect/Append().(val, elems...)) |
| 1511 | |
| 1512 | return nil |
| 1513 | } |
| 1514 | |
| 1515 | // ValueUnmarshalerDecodeValue is the ValueDecoderFunc for ValueUnmarshaler implementations. |
| 1516 | // |
| 1517 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1518 | // value decoders registered. |
| 1519 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) ValueUnmarshalerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#ValueUnmarshalerDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1520 | if !val.IsValidscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsValid().() || (!val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.) && !reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.PtrToscip-go gomod github.com/golang/go/src go1.18 reflect/PtrTo().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()).Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.)) { |
| 1521 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ValueUnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1522 | } |
| 1523 | |
| 1524 | // If BSON value is null and the go value is a pointer, then don't call |
| 1525 | // UnmarshalBSONValue. Even if the Go pointer is already initialized (i.e., |
| 1526 | // non-nil), encountering null in BSON will result in the pointer being |
| 1527 | // directly set to nil here. Since the pointer is being replaced with nil, |
| 1528 | // there is no opportunity (or reason) for the custom UnmarshalBSONValue logic |
| 1529 | // to be called. |
| 1530 | if vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() == bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null. && val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr. { |
| 1531 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1532 | |
| 1533 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1534 | } |
| 1535 | |
| 1536 | if val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr. && val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 1537 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() { |
| 1538 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ValueUnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1539 | } |
| 1540 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().())) |
| 1541 | } |
| 1542 | |
| 1543 | if !val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.) { |
| 1544 | if !val.CanAddrscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanAddr().() { |
| 1545 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ValueUnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1546 | } |
| 1547 | val = val.Addrscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Addr().() // If the type doesn't implement the interface, a pointer to it must. |
| 1548 | } |
| 1549 | |
| 1550 | t, src, err := bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.Copierscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#{}.CopyValueToBytesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#CopyValueToBytes().(vr) |
| 1551 | if err != nil { |
| 1552 | return err |
| 1553 | } |
| 1554 | |
| 1555 | m, ok := val.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().().(ValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueUnmarshaler#) |
| 1556 | if !ok { |
| 1557 | // NB: this error should be unreachable due to the above checks |
| 1558 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "ValueUnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tValueUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tValueUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1559 | } |
| 1560 | return m.UnmarshalBSONValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueUnmarshaler#UnmarshalBSONValue.(t, src) |
| 1561 | } |
| 1562 | |
| 1563 | // UnmarshalerDecodeValue is the ValueDecoderFunc for Unmarshaler implementations. |
| 1564 | // |
| 1565 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1566 | // value decoders registered. |
| 1567 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) UnmarshalerDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#UnmarshalerDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1568 | if !val.IsValidscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsValid().() || (!val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.) && !reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.PtrToscip-go gomod github.com/golang/go/src go1.18 reflect/PtrTo().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().()).Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.)) { |
| 1569 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1570 | } |
| 1571 | |
| 1572 | if val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr. && val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 1573 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() { |
| 1574 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1575 | } |
| 1576 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().())) |
| 1577 | } |
| 1578 | |
| 1579 | _, src, err := bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.Copierscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#{}.CopyValueToBytesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#CopyValueToBytes().(vr) |
| 1580 | if err != nil { |
| 1581 | return err |
| 1582 | } |
| 1583 | |
| 1584 | // If the target Go value is a pointer and the BSON field value is empty, set the value to the |
| 1585 | // zero value of the pointer (nil) and don't call UnmarshalBSON. UnmarshalBSON has no way to |
| 1586 | // change the pointer value from within the function (only the value at the pointer address), |
| 1587 | // so it can't set the pointer to "nil" itself. Since the most common Go value for an empty BSON |
| 1588 | // field value is "nil", we set "nil" here and don't call UnmarshalBSON. This behavior matches |
| 1589 | // the behavior of the Go "encoding/json" unmarshaler when the target Go value is a pointer and |
| 1590 | // the JSON field value is "null". |
| 1591 | if val.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() == reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr. && len(src) == 0 { |
| 1592 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1593 | return nil |
| 1594 | } |
| 1595 | |
| 1596 | if !val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Implementsscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Implements().(tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.) { |
| 1597 | if !val.CanAddrscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanAddr().() { |
| 1598 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1599 | } |
| 1600 | val = val.Addrscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Addr().() // If the type doesn't implement the interface, a pointer to it must. |
| 1601 | } |
| 1602 | |
| 1603 | m, ok := val.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().().(Unmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Unmarshaler#) |
| 1604 | if !ok { |
| 1605 | // NB: this error should be unreachable due to the above checks |
| 1606 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "UnmarshalerDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tUnmarshalerscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tUnmarshaler.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1607 | } |
| 1608 | return m.UnmarshalBSONscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Unmarshaler#UnmarshalBSON.(src) |
| 1609 | } |
| 1610 | |
| 1611 | // EmptyInterfaceDecodeValue is the ValueDecoderFunc for interface{}. |
| 1612 | // |
| 1613 | // Deprecated: EmptyInterfaceDecodeValue is not registered by default. Use EmptyInterfaceCodec.DecodeValue instead. |
| 1614 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) EmptyInterfaceDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#EmptyInterfaceDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1615 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty. { |
| 1616 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "EmptyInterfaceDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1617 | } |
| 1618 | |
| 1619 | rtype, err := dc.LookupTypeMapEntryscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupTypeMapEntry().(vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1620 | if err != nil { |
| 1621 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 1622 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 1623 | if dc.Ancestorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Ancestor. != nil { |
| 1624 | rtype = dc.Ancestorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#Ancestor. |
| 1625 | break |
| 1626 | } |
| 1627 | rtype = tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD. |
| 1628 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1629 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().())) |
| 1630 | return vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1631 | default: |
| 1632 | return err |
| 1633 | } |
| 1634 | } |
| 1635 | |
| 1636 | decoder, err := dc.LookupDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupDecoder().(rtype) |
| 1637 | if err != nil { |
| 1638 | return err |
| 1639 | } |
| 1640 | |
| 1641 | elem := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(rtype).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().() |
| 1642 | err = decoder.DecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoder#DecodeValue.(dc, vr, elem) |
| 1643 | if err != nil { |
| 1644 | return err |
| 1645 | } |
| 1646 | |
| 1647 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1648 | return nil |
| 1649 | } |
| 1650 | |
| 1651 | // CoreDocumentDecodeValue is the ValueDecoderFunc for bsoncore.Document. |
| 1652 | // |
| 1653 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1654 | // value decoders registered. |
| 1655 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) CoreDocumentDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#CoreDocumentDecodeValue().(_ DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1656 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tCoreDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCoreDocument. { |
| 1657 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "CoreDocumentDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tCoreDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCoreDocument.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1658 | } |
| 1659 | |
| 1660 | if val.IsNilscip-go gomod github.com/golang/go/src go1.18 reflect/Value#IsNil().() { |
| 1661 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.MakeSlicescip-go gomod github.com/golang/go/src go1.18 reflect/MakeSlice().(val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().(), 0, 0)) |
| 1662 | } |
| 1663 | |
| 1664 | val.SetLenscip-go gomod github.com/golang/go/src go1.18 reflect/Value#SetLen().(0) |
| 1665 | |
| 1666 | cdoc, err := bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.Copierscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#{}.AppendDocumentBytesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/Copier#AppendDocumentBytes().(val.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().().(bsoncorescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/x/bsonx/bsoncore`/.Documentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/x/bsonx/bsoncore`/Document#), vr) |
| 1667 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(cdoc)) |
| 1668 | return err |
| 1669 | } |
| 1670 | |
| 1671 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) decodeDefaultscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeDefault().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) ([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1672 | elems := make([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, 0) |
| 1673 | |
| 1674 | ar, err := vr.ReadArrayscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadArray.() |
| 1675 | if err != nil { |
| 1676 | return nil, err |
| 1677 | } |
| 1678 | |
| 1679 | eType := val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Type#Elem().() |
| 1680 | |
| 1681 | decoder, err := dc.LookupDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupDecoder().(eType) |
| 1682 | if err != nil { |
| 1683 | return nil, err |
| 1684 | } |
| 1685 | eTypeDecoder, _ := decoder.(typeDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/typeDecoder#) |
| 1686 | |
| 1687 | idx := 0 |
| 1688 | for { |
| 1689 | vr, err := ar.ReadValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ArrayReader#ReadValue.() |
| 1690 | if errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Isscip-go gomod github.com/golang/go/src go1.18 errors/Is().(err, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ErrEOAscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ErrEOA.) { |
| 1691 | break |
| 1692 | } |
| 1693 | if err != nil { |
| 1694 | return nil, err |
| 1695 | } |
| 1696 | |
| 1697 | elem, err := decodeTypeOrValueWithInfoscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/decodeTypeOrValueWithInfo().(decoder, eTypeDecoder, dc, vr, eType, true) |
| 1698 | if err != nil { |
| 1699 | return nil, newDecodeErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/newDecodeError().(strconvscip-go gomod github.com/golang/go/src go1.18 strconv/.Itoascip-go gomod github.com/golang/go/src go1.18 strconv/Itoa().(idx), err) |
| 1700 | } |
| 1701 | elems = append(elems, elem) |
| 1702 | idx++ |
| 1703 | } |
| 1704 | |
| 1705 | return elems, nil |
| 1706 | } |
| 1707 | |
| 1708 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) readCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#readCodeWithScope().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#) (primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope#, error) { |
| 1709 | var cws primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope# |
| 1710 | |
| 1711 | code, dr, err := vr.ReadCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadCodeWithScope.() |
| 1712 | if err != nil { |
| 1713 | return cws, err |
| 1714 | } |
| 1715 | |
| 1716 | scope := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD.).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().() |
| 1717 | elems, err := dvd.decodeElemsFromDocumentReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeElemsFromDocumentReader().(dc, dr) |
| 1718 | if err != nil { |
| 1719 | return cws, err |
| 1720 | } |
| 1721 | |
| 1722 | scope.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.MakeSlicescip-go gomod github.com/golang/go/src go1.18 reflect/MakeSlice().(tDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tD., 0, len(elems))) |
| 1723 | scope.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Appendscip-go gomod github.com/golang/go/src go1.18 reflect/Append().(scope, elems...)) |
| 1724 | |
| 1725 | cws = primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope#{ |
| 1726 | Codescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope#Code.: primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.JavaScriptscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/JavaScript#(code), |
| 1727 | Scopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope#Scope.: scope.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Dscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/D#), |
| 1728 | } |
| 1729 | return cws, nil |
| 1730 | } |
| 1731 | |
| 1732 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) codeWithScopeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#codeWithScopeDecodeType().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, t reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#) (reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1733 | if t != tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope. { |
| 1734 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{ |
| 1735 | Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "CodeWithScopeDecodeValue", |
| 1736 | Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope.}, |
| 1737 | Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Zeroscip-go gomod github.com/golang/go/src go1.18 reflect/Zero().(t), |
| 1738 | } |
| 1739 | } |
| 1740 | |
| 1741 | var cws primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/CodeWithScope# |
| 1742 | var err error |
| 1743 | switch vrType := vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.(); vrType { |
| 1744 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.CodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/CodeWithScope.: |
| 1745 | cws, err = dvd.readCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#readCodeWithScope().(dc, vr) |
| 1746 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Nullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Null.: |
| 1747 | err = vr.ReadNullscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadNull.() |
| 1748 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Undefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Undefined.: |
| 1749 | err = vr.ReadUndefinedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadUndefined.() |
| 1750 | default: |
| 1751 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a primitive.CodeWithScope", vrType) |
| 1752 | } |
| 1753 | if err != nil { |
| 1754 | return emptyValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/emptyValue., err |
| 1755 | } |
| 1756 | |
| 1757 | return reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(cws), nil |
| 1758 | } |
| 1759 | |
| 1760 | // CodeWithScopeDecodeValue is the ValueDecoderFunc for CodeWithScope. |
| 1761 | // |
| 1762 | // Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default |
| 1763 | // value decoders registered. |
| 1764 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) CodeWithScopeDecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#CodeWithScopeDecodeValue().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, val reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) error { |
| 1765 | if !val.CanSetscip-go gomod github.com/golang/go/src go1.18 reflect/Value#CanSet().() || val.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().() != tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope. { |
| 1766 | return ValueDecoderErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#{Namescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Name.: "CodeWithScopeDecodeValue", Typesscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Types.: []reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Type#{tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope.}, Receivedscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoderError#Received.: val} |
| 1767 | } |
| 1768 | |
| 1769 | elem, err := dvd.codeWithScopeDecodeTypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#codeWithScopeDecodeType().(dc, vr, tCodeWithScopescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tCodeWithScope.) |
| 1770 | if err != nil { |
| 1771 | return err |
| 1772 | } |
| 1773 | |
| 1774 | val.Setscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Set().(elem) |
| 1775 | return nil |
| 1776 | } |
| 1777 | |
| 1778 | func (dvd DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) decodeDscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeD().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, vr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ValueReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#, _ reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#) ([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1779 | switch vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.() { |
| 1780 | case bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/Type#(0), bsontypescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/.EmbeddedDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsontype`/EmbeddedDocument.: |
| 1781 | default: |
| 1782 | return nil, fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("cannot decode %v into a D", vr.Typescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#Type.()) |
| 1783 | } |
| 1784 | |
| 1785 | dr, err := vr.ReadDocumentscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ValueReader#ReadDocument.() |
| 1786 | if err != nil { |
| 1787 | return nil, err |
| 1788 | } |
| 1789 | |
| 1790 | return dvd.decodeElemsFromDocumentReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeElemsFromDocumentReader().(dc, dr) |
| 1791 | } |
| 1792 | |
| 1793 | func (DefaultValueDecodersscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#) decodeElemsFromDocumentReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DefaultValueDecoders#decodeElemsFromDocumentReader().(dc DecodeContextscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/DecodeContext#, dr bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.DocumentReaderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/DocumentReader#) ([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, error) { |
| 1794 | decoder, err := dc.LookupDecoderscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/Registry#LookupDecoder().(tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty.) |
| 1795 | if err != nil { |
| 1796 | return nil, err |
| 1797 | } |
| 1798 | |
| 1799 | elems := make([]reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Valuescip-go gomod github.com/golang/go/src go1.18 reflect/Value#, 0) |
| 1800 | for { |
| 1801 | key, vr, err := dr.ReadElementscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/DocumentReader#ReadElement.() |
| 1802 | if errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Isscip-go gomod github.com/golang/go/src go1.18 errors/Is().(err, bsonrwscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/.ErrEODscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsonrw`/ErrEOD.) { |
| 1803 | break |
| 1804 | } |
| 1805 | if err != nil { |
| 1806 | return nil, err |
| 1807 | } |
| 1808 | |
| 1809 | val := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Newscip-go gomod github.com/golang/go/src go1.18 reflect/New().(tEmptyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/tEmpty.).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().() |
| 1810 | err = decoder.DecodeValuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/ValueDecoder#DecodeValue.(dc, vr, val) |
| 1811 | if err != nil { |
| 1812 | return nil, newDecodeErrorscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/bsoncodec`/newDecodeError().(key, err) |
| 1813 | } |
| 1814 | |
| 1815 | elems = append(elems, reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(primitivescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/.Escip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#{Keyscip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#Key.: key, Valuescip-go gomod go.mongodb.org/mongo-driver . `go.mongodb.org/mongo-driver/bson/primitive`/E#Value.: val.Interfacescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Interface().()})) |
| 1816 | } |
| 1817 | |
| 1818 | return elems, nil |
| 1819 | } |