• Steven Allen's avatar
    fix(key): only count a key as an ancestor or prefix if there is a separator · 5598edf1
    Steven Allen authored
    Also make sure to clean and normalize keys before using them as prefixes.
    
    BREAKING CHANGES:
    
    * `myds.Query(Query{Prefix:"/foo"})` will no longer match "/foobar" (or even
      "/foo"). This is usually what the user expects, we had a tendency to normalize
      "/foo/" to "/foo" (when we clean keys), and many datastores can't efficiently
      search for prefixes that aren't on path-boundaries anyways.
    * Given a mount datastore with mounts `["/foo", "/"]`, `myds.Put("/foo", "bar")`
      will put the value to the datastore mounted at "/", not "/foo", as the key "/"
      and "" usually doesn't make sense.
    
    While technically breaking, these changes are much more likely to fix bugs than
    they are to break things.
    5598edf1
mount.go 8.29 KB