-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
129 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/test/module/cascade/level1.ts → test/module/cascade/level1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Collection } from '../../../decorators'; | ||
import { Entity } from '../../../entity'; | ||
import { Collection } from '../../../src/decorators'; | ||
import { Entity } from '../../../src/entity'; | ||
|
||
@Collection('relationshipEntityLevel1Test') | ||
export class RelationshipEntityLevel1Test extends Entity {} |
10 changes: 5 additions & 5 deletions
10
...test/module/cascade/level1WithChildren.ts → test/module/cascade/level1WithChildren.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/test/module/cascade/level2.ts → test/module/cascade/level2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/test/module/cascade/level3.ts → test/module/cascade/level3.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...est/module/entity.dynamic.relationship.ts → test/module/entity.dynamic.relationship.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Collection } from '../../src/decorators'; | ||
import { Entity } from '../../src/entity'; | ||
import { Index } from '../../src/indexes/decorators'; | ||
|
||
@Collection('testwithindex') | ||
export class EntityWithIndexTest extends Entity { | ||
@Index({ | ||
unique: true | ||
}) | ||
foo: string; | ||
} |
8 changes: 4 additions & 4 deletions
8
src/test/module/entity.nested.ts → test/module/entity.nested.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/test/module/entity.relationship.ts → test/module/entity.relationship.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { IsString } from 'class-validator'; | ||
import { ObjectId } from 'mongodb'; | ||
|
||
import { Collection } from '../../src/decorators'; | ||
import { Entity } from '../../src/entity'; | ||
import { Index } from '../../src/indexes/decorators'; | ||
import { Relationship } from '../../src/relationship/decorators'; | ||
import { EntityChildTest } from './child'; | ||
|
||
export const TEST_COLLECTION_NAME = 'testuniquerelationship'; | ||
|
||
@Collection(TEST_COLLECTION_NAME) | ||
export class EntityUniqueRelationship extends Entity { | ||
@IsString() | ||
@Index() | ||
bar: string; | ||
|
||
@Relationship({ | ||
type: () => EntityChildTest | ||
}) | ||
@Index({ | ||
key: { child: 1, child2: 1 }, | ||
unique: true, | ||
sparse: true | ||
}) | ||
child?: ObjectId; | ||
|
||
@Relationship({ | ||
type: () => EntityChildTest | ||
}) | ||
child2?: ObjectId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters