Escape MongoDB keys for characters . and $.
package main
import "github.com/segmentio/go-mongo-key-escape"
func main() {
mongo.Escape("event.thing")
// event\uFF0Ething
mongo.Unescape("event\uFF0Ething")
// event.thing
mongo.Escape("event$thing")
// event\uFF04thing
mongo.Unescape("event\uFF04thing")
// event$thing
}
MIT