Skip to content

segment-boneyard/go-mongo-key-escape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

go-mongo-key-escape

Escape MongoDB keys for characters . and $.

Example

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
}

License

MIT

About

Escape MongoDB keys for characters . and $

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages