Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support to mongodb v5 #9925

Merged
merged 8 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ await timber.remove()

- for **MongoDB** (experimental)

`npm install mongodb@^3.6.0 --save`
`npm install mongodb@^5.2.0 --save`

- for **NativeScript**, **react-native** and **Cordova**

Expand Down
2 changes: 1 addition & 1 deletion README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ await timber.remove();

- **MongoDB** (experimental)의 경우

`npm install mongodb@^3.6.0 --save`
`npm install mongodb@^5.2.0 --save`

- **NativeScript**, **react-native**, **Cordova**의 경우

Expand Down
6 changes: 3 additions & 3 deletions docs/decorator-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,16 @@ Learn more about [entity columns](entities.md#entity-columns).

#### `@ObjectIdColumn`

Marks a property in your entity as ObjectID.
Marks a property in your entity as ObjectId.
This decorator is only used in MongoDB.
Every entity in MongoDB must have a ObjectID column.
Every entity in MongoDB must have a ObjectId column.
Example:

```typescript
@Entity()
export class User {
@ObjectIdColumn()
id: ObjectID
id: ObjectId
}
```

Expand Down
16 changes: 6 additions & 10 deletions docs/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ instead of `@PrimaryColumn` or `@PrimaryGeneratedColumn`.
Simple entity example:

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm"
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm"

@Entity()
export class User {
@ObjectIdColumn()
id: ObjectID
id: ObjectId

@Column()
firstName: string
Expand Down Expand Up @@ -54,7 +54,7 @@ Since MongoDB stores objects and objects inside objects (or documents inside doc
you can do the same in TypeORM:

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm"
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm"

export class Profile {
@Column()
Expand All @@ -69,7 +69,7 @@ export class Profile {
```

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm"
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm"

export class Photo {
@Column()
Expand All @@ -90,12 +90,12 @@ export class Photo {
```

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm"
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm"

@Entity()
export class User {
@ObjectIdColumn()
id: ObjectID
id: ObjectId

@Column()
firstName: string
Expand Down Expand Up @@ -373,10 +373,6 @@ Returns if the collection is a capped collection.

Get the list of all indexes information for the collection.

#### `mapReduce`

Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.

#### `parallelCollectionScan`

Return N number of parallel cursors for a collection allowing parallel reading of entire collection. There are no ordering guarantees for returned results
Expand Down
16 changes: 6 additions & 10 deletions docs/zh_CN/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ TypeORM 大多数功能都是特定于 RDBMS 的,
简单实体示例:

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm";
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm";

@Entity()
export class User {
@ObjectIdColumn()
id: ObjectID;
id: ObjectId;

@Column()
firstName: string;
Expand Down Expand Up @@ -51,7 +51,7 @@ const connection: Connection = await createConnection({
由于 MongoDB 存储对象和对象内的对象(或文档内的文档),因此你可以在 TypeORM 中执行相同的操作:

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm";
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm";

export class Profile {
@Column()
Expand All @@ -66,7 +66,7 @@ export class Profile {
```

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm";
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm";

export class Photo {
@Column()
Expand All @@ -87,12 +87,12 @@ export class Photo {
```

```typescript
import { Entity, ObjectID, ObjectIdColumn, Column } from "typeorm";
import { Entity, ObjectId, ObjectIdColumn, Column } from "typeorm";

@Entity()
export class User {
@ObjectIdColumn()
id: ObjectID;
id: ObjectId;

@Column()
firstName: string;
Expand Down Expand Up @@ -297,10 +297,6 @@ distinct 命令返回集合中给定键的不同值列表。

获取集合的所有索引信息的列表。

#### `mapReduce`

在集合中运行 Map Reduce。 请注意,out 的内联选项将返回结果数组而不是集合。

#### `parallelCollectionScan`

为集合返回 N 个并行游标,允许并行读取整个集合。 返回的结果没有顺序保证。
Expand Down
Loading