Back to / internal / objectid

package objectid

Latest Go to latest
Published: Oct 7, 2019 | License: Apache-2.0 | Module:


func Parse

func Parse(s string) (bson.ObjectId, bool)

Parse parses the given string and returns a bson.ObjectId and true if the given value is valid, otherwise it will return an empty bson.ObjectId and false.

This is copy of the bson.ObjectIdHex function, but prevents doing double decode in the classic procedure: if bson.IsObjectId(x) { bson.ObjectIdHex(x} }

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier