Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Aug 17, 2022
1 parent 77d3bfe commit c4b2ea7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
12 changes: 12 additions & 0 deletions integration/shareddata/composites.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"math"

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)

// Composites contain composite values for tests.
Expand Down Expand Up @@ -76,3 +77,14 @@ var DocumentsStrings = &Values[string]{
// "document-empty": bson.D{},
},
}

// DocumentsDocuments contains documents with documents with string values for tests.
var DocumentsDocuments = &Values[primitive.ObjectID]{
name: "DocumentsDocuments",
handlers: []string{"pg", "tigris"},
data: map[primitive.ObjectID]any{
{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}: bson.D{{"foo", int32(42)}},
// TODO Dealing with empty doc needs a schema to be defined https://github.com/FerretDB/FerretDB/issues/772
// {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}: bson.D{{"v", bson.D{}}},
},
}
1 change: 1 addition & 0 deletions integration/shareddata/shareddata.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func AllProviders() []Provider {

DocumentsDoubles,
DocumentsStrings,
DocumentsDocuments,
}

// check that names are unique and randomize order
Expand Down
26 changes: 14 additions & 12 deletions integration/update_field_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,20 @@ func TestUpdateFieldCompatUnset(t *testing.T) {
"Simple": {
update: bson.D{{"$unset", bson.D{{"v", ""}}}},
},
// "NotExistedField": {
// update: bson.D{{"$unset", bson.D{{"foo", ""}}}},
// },
// "NestedField": {
// update: bson.D{{"$unset", bson.D{{"v", bson.D{{"array", ""}}}}}},
// },
// "DotNotationDocumentFieldExist": {
// update: bson.D{{"$unset", bson.D{{"v.foo", ""}}}},
// },
// "DotNotationDocumentFieldNotExist": {
// update: bson.D{{"$unset", bson.D{{"foo.bar", ""}}}},
// },
"NonExisting": {
update: bson.D{{"$unset", bson.D{{"foo", ""}}}},
resultType: emptyResult,
},
"Nested": {
update: bson.D{{"$unset", bson.D{{"v", bson.D{{"array", ""}}}}}},
},
"DotNotationDocument": {
update: bson.D{{"$unset", bson.D{{"v.foo", ""}}}},
},
"DotNotationDocumentNonExisting": {
update: bson.D{{"$unset", bson.D{{"foo.bar", ""}}}},
resultType: emptyResult,
},
// "DotNotationArrayFieldExist": {
// update: bson.D{{"$unset", bson.D{{"v.array.0", int32(1)}}}},
// },
Expand Down

0 comments on commit c4b2ea7

Please sign in to comment.