Skip to content

Commit

Permalink
fix: Incorporate schema root into docID (#2701)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #2688

## Description

Incorporates schema root into docID.
  • Loading branch information
AndrewSisley authored Jun 10, 2024
1 parent efef0c9 commit ea68087
Show file tree
Hide file tree
Showing 207 changed files with 6,002 additions and 5,384 deletions.
5 changes: 5 additions & 0 deletions client/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,11 @@ func (doc *Document) GenerateDocID() (DocID, error) {
return DocID{}, err
}

// The DocID must take into consideration the schema root, this ensures that
// otherwise identical documents created using different schema will have different
// document IDs - we do not want cross-schema docID collisions.
bytes = append(bytes, []byte(doc.collectionDefinition.Schema.Root)...)

cid, err := ccid.NewSHA256CidV1(bytes)
if err != nil {
return DocID{}, err
Expand Down
3 changes: 3 additions & 0 deletions docs/data_format_changes/i2688-doc-id-includes-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Incorporate schema root into docID

DocID generation now incorporates schema root, meaning documents created against different schema will no longer clash. This change also means that all the docIDs and commit CIDs have changed.
2 changes: 1 addition & 1 deletion docs/website/guides/schema-relationship.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mutation {

```graphql
mutation {
create_User(input: {name: "Alice", username: "awesomealice", age: 35, address_id: "bae-fd541c25-229e-5280-b44b-e5c2af3e374d"}) {
create_User(input: {name: "Alice", username: "awesomealice", age: 35, address_id: "bae-be6d8024-4953-5a92-84b4-f042d25230c6"}) {
_key
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/website/guides/time-traveling-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A powerful feature of a time-traveling query is that very little work is require
query {
User (
cid: "bafybeieqnthjlvr64aodivtvtwgqelpjjvkmceyz4aqerkk5h23kjoivmu",
dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f"
dockey: "bae-d4303725-7db9-53d2-b324-f3ee44020e52"
) {
name
age
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Commits queries also work with aggregates, grouping, limit, offset, order, docke
There is __typename introspection keyword that works on all queries that does not appear to be documented anywhere, for example:

```graphql
commits(dockey: "bae-52b9170d-b77a-5887-b877-cbdbb99b009f") {
commits(dockey: "bae-d4303725-7db9-53d2-b324-f3ee44020e52") {
cid
__typename
}
Expand Down
32 changes: 16 additions & 16 deletions internal/db/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestBasicExport_WithNormalFormatting_NoError(t *testing.T) {
require.NoError(t, err)

expectedMap := map[string]any{}
data := []byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","_docIDNew":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","age":40,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-e933420a-988a-56f8-8952-6c245aebd519","age":30,"name":"John"}]}`)
data := []byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":30,"name":"John"},{"_docID":"bae-f8a0f1e4-129e-50ab-98ed-1aa110810fb2","_docIDNew":"bae-f8a0f1e4-129e-50ab-98ed-1aa110810fb2","age":40,"name":"Bob"}]}`)
err = json.Unmarshal(data, &expectedMap)
require.NoError(t, err)
require.EqualValues(t, expectedMap, fileMap)
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestBasicExport_WithPrettyFormatting_NoError(t *testing.T) {
require.NoError(t, err)

expectedMap := map[string]any{}
data := []byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","_docIDNew":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","age":40,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-e933420a-988a-56f8-8952-6c245aebd519","age":30,"name":"John"}]}`)
data := []byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":30,"name":"John"},{"_docID":"bae-f8a0f1e4-129e-50ab-98ed-1aa110810fb2","_docIDNew":"bae-f8a0f1e4-129e-50ab-98ed-1aa110810fb2","age":40,"name":"Bob"}]}`)
err = json.Unmarshal(data, &expectedMap)
require.NoError(t, err)
require.EqualValues(t, expectedMap, fileMap)
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestBasicExport_WithSingleCollection_NoError(t *testing.T) {
require.NoError(t, err)

expectedMap := map[string]any{}
data := []byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}]}`)
data := []byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}]}`)
err = json.Unmarshal(data, &expectedMap)
require.NoError(t, err)
require.EqualValues(t, expectedMap, fileMap)
Expand Down Expand Up @@ -252,10 +252,10 @@ func TestBasicExport_WithMultipleCollectionsAndUpdate_NoError(t *testing.T) {
col2, err := db.GetCollectionByName(ctx, "Book")
require.NoError(t, err)

doc3, err := client.NewDocFromJSON([]byte(`{"name": "John and the sourcerers' stone", "author": "bae-e933420a-988a-56f8-8952-6c245aebd519"}`), col2.Definition())
doc3, err := client.NewDocFromJSON([]byte(`{"name": "John and the sourcerers' stone", "author": "bae-7fca96a2-5f01-5558-a81f-09b47587f26d"}`), col2.Definition())
require.NoError(t, err)

doc4, err := client.NewDocFromJSON([]byte(`{"name": "Game of chains", "author": "bae-e933420a-988a-56f8-8952-6c245aebd519"}`), col2.Definition())
doc4, err := client.NewDocFromJSON([]byte(`{"name": "Game of chains", "author": "bae-7fca96a2-5f01-5558-a81f-09b47587f26d"}`), col2.Definition())
require.NoError(t, err)

err = col2.Create(ctx, doc3)
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestBasicExport_WithMultipleCollectionsAndUpdate_NoError(t *testing.T) {
require.NoError(t, err)

expectedMap := map[string]any{}
data := []byte(`{"Book":[{"_docID":"bae-4399f189-138d-5d49-9e25-82e78463677b","_docIDNew":"bae-78a40f28-a4b8-5dca-be44-392b0f96d0ff","author_id":"bae-807ea028-6c13-5f86-a72b-46e8b715a162","name":"Game of chains"},{"_docID":"bae-5cf2fec3-d8ed-50d5-8286-39109853d2da","_docIDNew":"bae-edeade01-2d21-5d6d-aadf-efc5a5279de5","author_id":"bae-807ea028-6c13-5f86-a72b-46e8b715a162","name":"John and the sourcerers' stone"}],"User":[{"_docID":"bae-0648f44e-74e8-593b-a662-3310ec278927","_docIDNew":"bae-0648f44e-74e8-593b-a662-3310ec278927","age":31,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-807ea028-6c13-5f86-a72b-46e8b715a162","age":31,"name":"John"}]}`)
data := []byte(`{"Book":[{"_docID":"bae-45c92e9c-4d31-5e96-8bd7-3d532734e117", "_docIDNew":"bae-3ca9a4c3-6240-5e86-a00f-9590d2f2ecf3", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone"}, {"_docID":"bae-8fc3d148-869b-5629-ae22-5423c73f709b", "_docIDNew":"bae-33c136bd-4375-54a0-81ff-54ca560c7bb8", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"Game of chains"}], "User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d", "_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "age":31, "name":"John"}, {"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "age":31, "name":"Bob"}]}`)
err = json.Unmarshal(data, &expectedMap)
require.NoError(t, err)
require.EqualValues(t, expectedMap, fileMap)
Expand Down Expand Up @@ -345,7 +345,7 @@ func TestBasicExport_EnsureFileOverwrite_NoError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","_docIDNew":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","age":40,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-e933420a-988a-56f8-8952-6c245aebd519","age":30,"name":"John"}]}`),
[]byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":40,"name":"Bob"},{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":30,"name":"John"}]}`),
0664,
)
require.NoError(t, err)
Expand All @@ -360,7 +360,7 @@ func TestBasicExport_EnsureFileOverwrite_NoError(t *testing.T) {
require.NoError(t, err)

expectedMap := map[string]any{}
data := []byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}]}`)
data := []byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}]}`)
err = json.Unmarshal(data, &expectedMap)
require.NoError(t, err)
require.EqualValues(t, expectedMap, fileMap)
Expand Down Expand Up @@ -393,7 +393,7 @@ func TestBasicImport_WithMultipleCollectionsAndObjects_NoError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`{"Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","_docIDNew":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","age":40,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-e933420a-988a-56f8-8952-6c245aebd519","age":30,"name":"John"}]}`),
[]byte(`{"Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":40,"name":"Bob"},{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":30,"name":"John"}]}`),
0664,
)
require.NoError(t, err)
Expand All @@ -412,20 +412,20 @@ func TestBasicImport_WithMultipleCollectionsAndObjects_NoError(t *testing.T) {
col1, err := db.getCollectionByName(ctx, "Address")
require.NoError(t, err)

key1, err := client.NewDocIDFromString("bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f")
key1, err := client.NewDocIDFromString("bae-41e1a410-df86-5846-939e-4470a8d8cb0c")
require.NoError(t, err)
_, err = col1.Get(ctx, key1, false)
require.NoError(t, err)

col2, err := db.getCollectionByName(ctx, "User")
require.NoError(t, err)

key2, err := client.NewDocIDFromString("bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df")
key2, err := client.NewDocIDFromString("bae-7fca96a2-5f01-5558-a81f-09b47587f26d")
require.NoError(t, err)
_, err = col2.Get(ctx, key2, false)
require.NoError(t, err)

key3, err := client.NewDocIDFromString("bae-e933420a-988a-56f8-8952-6c245aebd519")
key3, err := client.NewDocIDFromString("bae-7fca96a2-5f01-5558-a81f-09b47587f26d")
require.NoError(t, err)
_, err = col2.Get(ctx, key3, false)
require.NoError(t, err)
Expand Down Expand Up @@ -456,7 +456,7 @@ func TestBasicImport_WithJSONArray_ReturnError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`["Address":[{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","_docIDNew":"bae-b94880d1-e6d2-542f-b9e0-5a369fafd0df","age":40,"name":"Bob"},{"_docID":"bae-e933420a-988a-56f8-8952-6c245aebd519","_docIDNew":"bae-e933420a-988a-56f8-8952-6c245aebd519","age":30,"name":"John"}]]`),
[]byte(`["Address":[{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}],"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":40,"name":"Bob"},{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","age":30,"name":"John"}]]`),
0664,
)
require.NoError(t, err)
Expand Down Expand Up @@ -492,7 +492,7 @@ func TestBasicImport_WithObjectCollection_ReturnError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`{"Address":{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}}`),
[]byte(`{"Address":{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}}`),
0664,
)
require.NoError(t, err)
Expand Down Expand Up @@ -528,7 +528,7 @@ func TestBasicImport_WithInvalidFilepath_ReturnError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`{"Address":{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}}`),
[]byte(`{"Address":{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}}`),
0664,
)
require.NoError(t, err)
Expand Down Expand Up @@ -565,7 +565,7 @@ func TestBasicImport_WithInvalidCollection_ReturnError(t *testing.T) {

err = os.WriteFile(
filepath,
[]byte(`{"Addresses":{"_docID":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","_docIDNew":"bae-8096f2c1-ea4c-5226-8ba5-17fc4b68ac1f","city":"Toronto","street":"101 Maple St"}}`),
[]byte(`{"Addresses":{"_docID":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","_docIDNew":"bae-41e1a410-df86-5846-939e-4470a8d8cb0c","city":"Toronto","street":"101 Maple St"}}`),
0664,
)
require.NoError(t, err)
Expand Down
32 changes: 16 additions & 16 deletions tests/integration/acp/index/query_with_relation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any {
},
testUtils.CreateDoc{
CollectionID: 0,
// bae-41598f0c-19bc-5da6-813b-e80f14a10df3
// bae-7aabc9d2-fbbc-5911-b0d0-b49a2a1d0e84
Doc: `{
"name": "John Grisham",
"age": 65,
Expand All @@ -66,29 +66,29 @@ func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any {
},
testUtils.CreateDoc{
CollectionID: 1,
Doc: `{
"name": "Painted House",
"rating": 4.9,
"author_id": "bae-41598f0c-19bc-5da6-813b-e80f14a10df3"
}`,
DocMap: map[string]any{
"name": "Painted House",
"rating": 4.9,
"author_id": testUtils.NewDocIndex(0, 0),
},
},
testUtils.CreateDoc{
Identity: acpUtils.Actor1Identity,
CollectionID: 1,
Doc: `{
"name": "A Time for Mercy",
"rating": 4.5,
"author_id": "bae-41598f0c-19bc-5da6-813b-e80f14a10df3"
}`,
DocMap: map[string]any{
"name": "A Time for Mercy",
"rating": 4.5,
"author_id": testUtils.NewDocIndex(0, 0),
},
},
testUtils.CreateDoc{
Identity: acpUtils.Actor1Identity,
CollectionID: 1,
Doc: `{
"name": "Theif Lord",
"rating": 4.8,
"author_id": "bae-b769708d-f552-5c3d-a402-ccfd7ac7fb04"
}`,
DocMap: map[string]any{
"name": "Theif Lord",
"rating": 4.8,
"author_id": testUtils.NewDocIndex(0, 1),
},
},
}
}
Expand Down
48 changes: 20 additions & 28 deletions tests/integration/acp/query/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,45 +104,37 @@ func getSetupEmployeeCompanyActions() []any {
},
testUtils.CreateDoc{
CollectionID: 0,
Doc: `
{
"name": "PubEmp in PubCompany",
"salary": 10000,
"company": "bae-1ab7ac86-3c68-5abb-b526-803858c9dccf"
}
`,
DocMap: map[string]any{
"name": "PubEmp in PubCompany",
"salary": 10000,
"company": testUtils.NewDocIndex(1, 0),
},
},
testUtils.CreateDoc{
CollectionID: 0,
Doc: `
{
"name": "PubEmp in PrivateCompany",
"salary": 20000,
"company": "bae-4aef4bd6-e2ee-5075-85a5-4d64bbf80bca"
}
`,
DocMap: map[string]any{
"name": "PubEmp in PrivateCompany",
"salary": 20000,
"company": testUtils.NewDocIndex(1, 1),
},
},
testUtils.CreateDoc{
CollectionID: 0,
Identity: acpUtils.Actor1Identity,
Doc: `
{
"name": "PrivateEmp in PubCompany",
"salary": 30000,
"company": "bae-1ab7ac86-3c68-5abb-b526-803858c9dccf"
}
`,
DocMap: map[string]any{
"name": "PrivateEmp in PubCompany",
"salary": 30000,
"company": testUtils.NewDocIndex(1, 0),
},
},
testUtils.CreateDoc{
CollectionID: 0,
Identity: acpUtils.Actor1Identity,
Doc: `
{
"name": "PrivateEmp in PrivateCompany",
"salary": 40000,
"company": "bae-4aef4bd6-e2ee-5075-85a5-4d64bbf80bca"
}
`,
DocMap: map[string]any{
"name": "PrivateEmp in PrivateCompany",
"salary": 40000,
"company": testUtils.NewDocIndex(1, 1),
},
},
}
}
24 changes: 12 additions & 12 deletions tests/integration/acp/query/relation_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ func TestACP_QueryManyToOneRelationObjectsWithoutIdentity(t *testing.T) {
}
`,
Results: []map[string]any{
{
"name": "PubEmp in PrivateCompany",
"company": nil,
},
{
"name": "PubEmp in PubCompany",
"company": map[string]any{"name": "Public Company"},
},
{
"name": "PubEmp in PrivateCompany",
"company": nil,
},
},
},
},
Expand Down Expand Up @@ -113,14 +113,14 @@ func TestACP_QueryManyToOneRelationObjectsWithIdentity(t *testing.T) {
"name": "PrivateEmp in PrivateCompany",
"company": map[string]any{"name": "Private Company"},
},
{
"name": "PubEmp in PrivateCompany",
"company": map[string]any{"name": "Private Company"},
},
{
"name": "PubEmp in PubCompany",
"company": map[string]any{"name": "Public Company"},
},
{
"name": "PubEmp in PrivateCompany",
"company": map[string]any{"name": "Private Company"},
},
},
},
},
Expand Down Expand Up @@ -191,14 +191,14 @@ func TestACP_QueryManyToOneRelationObjectsWithWrongIdentity(t *testing.T) {
}
`,
Results: []map[string]any{
{
"name": "PubEmp in PrivateCompany",
"company": nil,
},
{
"name": "PubEmp in PubCompany",
"company": map[string]any{"name": "Public Company"},
},
{
"name": "PubEmp in PrivateCompany",
"company": nil,
},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/acp/register_and_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func TestACP_CreateWithIdentityAndDeleteWithoutIdentity_CanNotDelete(t *testing.
`,
Results: []map[string]any{
{
"_docID": "bae-1e608f7d-b01e-5dd5-ad4a-9c6cc3005a36",
"_docID": "bae-9d443d0c-52f6-568b-8f74-e8ff0825697b",
"name": "Shahzad",
"age": int64(28),
},
Expand Down Expand Up @@ -501,7 +501,7 @@ func TestACP_CreateWithIdentityAndDeleteWithWrongIdentity_CanNotDelete(t *testin
`,
Results: []map[string]any{
{
"_docID": "bae-1e608f7d-b01e-5dd5-ad4a-9c6cc3005a36",
"_docID": "bae-9d443d0c-52f6-568b-8f74-e8ff0825697b",
"name": "Shahzad",
"age": int64(28),
},
Expand Down
Loading

0 comments on commit ea68087

Please sign in to comment.