File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,14 @@ func (rv RawValue) AsInt64() int64 { return convertToCoreValue(rv).AsInt64() }
294294// panicking.
295295func (rv RawValue ) AsInt64OK () (int64 , bool ) { return convertToCoreValue (rv ).AsInt64OK () }
296296
297+ // AsFloat64 returns a BSON number as a float64. If the BSON type is not a numeric one, this method
298+ // will panic.
299+ func (rv RawValue ) AsFloat64 () float64 { return convertToCoreValue (rv ).AsFloat64 () }
300+
301+ // AsFloat64OK is the same as AsFloat64, except that it returns a boolean instead of
302+ // panicking.
303+ func (rv RawValue ) AsFloat64OK () (float64 , bool ) { return convertToCoreValue (rv ).AsFloat64OK () }
304+
297305// Decimal128 returns the decimal the Value represents. It panics if the value is a BSON type other than
298306// decimal.
299307func (rv RawValue ) Decimal128 () Decimal128 { return NewDecimal128 (convertToCoreValue (rv ).Decimal128 ()) }
You can’t perform that action at this time.
0 commit comments