package
0.0.0-20250307203412-7e5349ef2bba
Repository: https://github.com/mongodb/mongo-tools.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
ConvertBSONValueToLegacyExtJSON walks through a document or an array and converts any BSON value to its corresponding extended JSON type.
ConvertLegacyExtJSONDocumentToBSON iterates through the document map and converts JSON values to their corresponding BSON values.
ConvertLegacyExtJSONValueToBSON walks through a document or an array and replaces any extended JSON value with its corresponding BSON type.
ConvertLegacyIndexKeys transforms the values of index definitions pre 3.4 into the stricter index definitions of 3.4+.
ConvertLegacyIndexKeyValue provides ConvertLegacyIndexKeys’s implementation without logging or mutating inputs.
ConvertLegacyIndexOptions removes options that don't match a known list of index options.
ConvertLegacyIndexOptionsFromOp removes options that don't match a known list of index options.
CreateExtJSONString stringifies doc as Extended JSON.
FindIntByKey returns the value of keyName in the document as an int for either int32 or int64 underlying type.
FindStringValueByKey returns the value of keyName in document as a String.
FindSubdocumentByKey returns the value of keyName in document as a document.
FindValueByKey returns the value of keyName in document.
GetBSONValueAsLegacyExtJSON is equivalent to ConvertBSONValueToLegacyExtJSON, but does not mutate its argument.
GetExtendedBsonD iterates through the document and returns a bson.D that adds type information for each key in document.
IsEqual marshals two documents to raw BSON and compares them.
No description provided by the author
MakeSortString takes a bson.D object and converts it to a slice of strings that can be used as the input args to mgo's .Sort(...) function.
MarshalExtJSONReversible is a wrapper around bson.MarshalExtJSON function, but would return an error if it cannot be reversed by bson.UnmarshalExtJSON.
MarshalExtJSONWithBSONRoundtripConsistency is a wrapper around bson.MarshalExtJSON which also validates that BSON objects that are marshaled to ExtJSON objects return a consistent BSON object when unmarshaled.
MtoD converts a bson.M to a bson.D.
ParseLegacyExtJSONValue takes any value generated by the json package and returns a BSON version of that value.
ParseSpecialKeys takes a JSON document and inspects it for any extended JSON type (e.g $numberLong) and replaces any such values with the corresponding BSON type.
RemoveKey removes the given key.
# Variables
No description provided by the author
# Type aliases
MarshalD is a wrapper for bson.D that allows unmarshalling of bson.D with preserved order.