diff --git a/packages/core/database/src/__tests__/repository/find.test.ts b/packages/core/database/src/__tests__/repository/find.test.ts index 9271d09bb..ee7c30355 100644 --- a/packages/core/database/src/__tests__/repository/find.test.ts +++ b/packages/core/database/src/__tests__/repository/find.test.ts @@ -188,8 +188,12 @@ describe('repository find', () => { appends: ['a1', 'a2'], }); + const data = user.toJSON(); + expect(user['a1']).toBeDefined(); expect(user['a2']).toBeDefined(); + expect(data['a1'][0].createdAt).toBeDefined(); + expect(data['a2'][0].createdAt).toBeDefined(); }); test('filter attribute', async () => { diff --git a/packages/core/database/src/utils.ts b/packages/core/database/src/utils.ts index 682514338..b0654011f 100644 --- a/packages/core/database/src/utils.ts +++ b/packages/core/database/src/utils.ts @@ -37,7 +37,9 @@ export async function handleAppendsQuery(options: HandleAppendsQueryOptions) { const key = appendedResult.include.association; const val = appendedResult.rows[i].get(key); - rows[i].set(key, val); + rows[i].set(key, val, { + raw: true, + }); } }