diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-18 13:28:04 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-18 13:28:04 -0700 |
commit | 9a77a3614dcd44d90180aa3971d6ca56788b6a0d (patch) | |
tree | c9c64d9af59a11b7de59d15bb1ac2e8e09a1dd99 | |
parent | 3b8689047ea6c38d1033b391f1598d40b1341103 (diff) |
adding different key format to test default sorting inside Bolt
-rw-r--r-- | system/db/content.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/db/content.go b/system/db/content.go index 524097a..a7510ab 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -245,14 +245,14 @@ func SortContent(namespace string) { return err } - // encode to json and store as post.ID:post + // encode to json and store as post.Time():post for _, post := range posts { j, err := json.Marshal(post) if err != nil { return err } - cid := fmt.Sprintf("%d", post.ContentID()) + cid := fmt.Sprintf("%d-%d", post.Time(), post.ContentID()) err = b.Put([]byte(cid), j) if err != nil { err := tx.Rollback() |