For storage, store as JSON rather than BSON

This commit is contained in:
breel
2020-08-27 15:29:17 -06:00
parent a6f5bc3192
commit d67654e601
4 changed files with 75 additions and 18 deletions

View File

@@ -1,12 +1,12 @@
package driver
import (
"encoding/json"
"local/dndex/storage/entity"
"testing"
"time"
"github.com/google/uuid"
"go.mongodb.org/mongo-driver/bson"
)
func TestNewStorage(t *testing.T) {
@@ -37,7 +37,7 @@ func fillStorage(t *testing.T, s *Storage) {
Connections: map[string]entity.Connection{p.ID: entity.Connection{p.Name}},
Attachments: map[string]entity.Attachment{"filename": {"/path/to/file"}},
}
b, err := bson.Marshal(o)
b, err := json.Marshal(o)
if err != nil {
t.Fatal(err)
}