Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ / /
Diango MongoDBバックエンド

Dpango とMongoDB機能の互換性

このページでは、Diango MongoDBバックエンドでサポートされている機能とサポートされていない機能に関する情報を見つけることができます。現在、将来のリリースが予定されている機能を見つけることもできます。ユーザーのリクエストに基づいて、これらの今後の機能を優先します。機能のサポートは JIRA 問題を作成する ことでリクエストできます。

Dlango MongoDBバックエンドは次の操作をサポートしていますが、パフォーマンスが低下する可能性があります。

操作
パフォーマンス ノート

$expr 操作

Queries that use the $expr operator might run slowly, since this operator often cannot predict which index to use and performs a collection scan. Some QuerySet operations, such as queries that specify an in lookup, use $expr to evaluate the query results and experience degraded performance.
We plan to address this performance issue in a post-GA release.

$lookup 操作

Queries that use the $lookup operator might run slowly. To improve performance, we recommend that you use embedded models instead of the $lookup operator when possible. To learn more about how to reduce $lookup operations, see the Reduce $lookup Operations guide in the MongoDB Atlas documentation.

このセクションでは、Diango MongoDBバックエンドがさまざまなMongoDB機能をサポートしているかどうかを示します。

MongoDB の機能
現在のサポート

Atlas Search インデックス

部分的にサポートされています。Dlango MongoDBバックエンドを使用して、インデックス名とインデックスを作成するフィールドを指定する基本的な Atlas Search インデックスを作成できます。他のインデックス定義フィールドはすべてサポートされていません。

MongoDB は、一部のデータ型で Atlas Search インデックスをサポートしていません。サポートされていない型のリストを表示するには、 MongoDB Atlasドキュメントのデータ型の制限を参照してください。

Atlas ベクトル検索インデックス

部分的にサポートされています。Dlango MongoDBバックエンドを使用して、インデックス名、インデックスを作成するフィールド、類似性関数を指定する基本的な Atlas ベクトル検索インデックスを作成できます。 他のインデックス定義フィールドはすべてサポートされていません。

複合インデックス

埋め込みドキュメントインデックス

地理空間インデックス

Multikey indexes

部分インデックス

単一フィールド インデックス

Unique indexes

モデル作成後の埋め込みモデル インデックスの更新

サポート対象外

EmbeddedModelArrayField indexes

PolymorphicEmbeddedModelField および PolymorphicEmbeddedModelArrayField インデックス

サポート対象外

Dlango MongoDBバックエンドは現在、次の表に含まれていないすべてのMongoDBデータ型をサポートしています。サポートされているタイプの完全なリストを表示するには、 モデルの作成ガイドの「 MongoDB BSONフィールド 」セクションを参照してください。

BSON データ型
現在のサポート

Object

You can use embedded models and polymorphic embedded models to represent objects. If you are using the EmbeddedModelField field, the following limitations apply: - Foreign key fields are not supported. - Arbitrary or untyped embedded model fields are not supported. You must derive all fields from an EmbeddedModel class.

Regular Expression

サポート対象外 。ただし、GA 以降のリリースでこのタイプをサポートする予定です。

MongoDB の機能
現在のサポート

集計操作

部分的にサポートされています 。Dlango MongoDBバックエンドにはMongoDB集計フレームワークのカスタム Dlangoフィールドルックアップは含まれていませんが、 raw_aggregate() メソッドを使用できます。

Atlas 検索クエリ

削除操作

地理空間クエリ

Use the raw_aggregate() method to run geospatial queries instead of the GIS QuerySet API.

挿入操作

読み取り操作

アップデート操作

ベクトル検索クエリ

MongoDB の機能
現在のサポート

非同期サポート

認証

キャッシュされたデータストレージ

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

変更ストリーム

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

クライアント側フィールドレベル暗号化とQueryable Encryption

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

コレクションのインタラクション

データベース インタラクション

GridFS

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

1 つのコレクションに複数のモデル

サポート対象外

ドキュメントの表現

Use models to represent MongoDB documents.

スキーマ検証

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

時系列データ

トランザクション

You can use Django MongoDB Backend's custom transactions API with the following limitations: - QuerySet.union() is not supported within a transaction. - Savepoints, or nested atomic blocks, are not supported. The outermost atomic block starts a transaction, and any subsequent atomic blocks have no effect. - Your MongoDB deployment must be a replica set or sharded cluster.

このセクションは、Diango MongoDBバックエンドがさまざまな Dlango 機能をサポートしているかどうかを示します。

Dlango MongoDBバックエンドは現在、次の表に含まれていないすべての Diango フィールドをサポートしています。サポートされているフィールドの完全なリストを表示するには、モデルの作成ガイドの「Dango フィールド」セクションを参照してください。

Diango フィールド型
現在のサポート

AutoField

サポート対象外BigAutoField および SmallAutoField タイプもサポートされていません。代わりに、ObjectIdField を使用してください。

CompositePrimaryKey

サポート対象外

DateTimeField

Microsecond granularity for DateTimeField values is not supported.

DurationField

DurationField stores milliseconds rather than microseconds.

ForeignKey

部分的にサポートされています 。このフィールド型は、次の制限付きで使用できます。

  • 可能であれば、$lookup 操作を使用しないように、ForeignKeyフィールドではなく EmbeddedModelField を使用する必要があります。 EmbeddedModelField はMongoDB埋め込みドキュメントをエミュレートし、パフォーマンスが ForeignKeyフィールドよりも向上します。 操作を削減する方法の詳細については、Atlas ドキュメントの「 $lookup 操作の削減 」ガイドを参照してください。$lookup

  • Performance of CASCADE deletes on a ForeignKey field is not as performant as using an EmbeddedModelField.

GeneratedField

サポート対象外

JSONField

部分的にサポートされています 。このフィールド型は、次の制限付きで使用できます。

  • Dlango MongoDBバックエンドは、 JSONとSQL null 値を区別できません。 Value(None, JSONField()) または isnull ルックアップを使用するクエリでは、 JSONとSQL null 値の両方が返されます。

  • Q(value__foo="bar") などの Q オブジェクトを含む一部のクエリは、通常どおりに動作しない可能性があります。

  • None 値をフィルタリングすると、フィールドが存在しないオブジェクトが誤って返されます。

Django MongoDB Backend currently supports all Django QuerySet methods not included in the following table. To view the supported methods, see QuerySet API in the Django documentation.

Diango QuerySet の機能
現在のサポート

delete()

You cannot use this method to perform queries that span multiple collections.

extra()

サポート対象外

パターン一致検索

You can only use these lookups to query string fields.
The pattern-matching lookups are iexact, startswith, istartswith, endswith, iendswith, contains, icontains, regex, and iregex

prefetch_related()

サポート対象外

raw()

サポート対象外 。ただし、MongoDB の集計パイプライン構文を使用するクエリは raw_aggregate() メソッドで実行できます。

update()

You cannot use this method to perform queries that span multiple collections.

Django MongoDB Backend currently supports all database functions not included in the following table. To view a full list of functions, see Database Functions in the Django documentation.

Dmango 関数
現在のサポート

Chr

サポート対象外

ExtractQuarter

サポート対象外

MD5

サポート対象外

Now

サポート対象外

Ord

サポート対象外

Pad

サポート対象外

Repeat

サポート対象外

Reverse

サポート対象外

Right

サポート対象外

SHA1, SHA224, SHA256, SHA384, SHA512

サポート対象外

Sign

サポート対象外

Trunc

Partially Supported. The tzinfo parameter of the TruncDate and TruncTime database functions is not supported.

Diango の機能
現在のサポート

Diango Admin

Diango 認証

GeoDjango

部分的にサポートされています 。この Webフレームワークは、次の制限付きでサポートされています。

  • The GIS QuerySet API is not supported.

  • MongoDB does not support any spatial reference system identifiers other than 4326.

  • RasterField はサポートされていません。

Diango MongoDBバックエンドは Diango の形式をサポートしていますが、PolymorphicEmbeddedModelFieldPolymorphicEmbeddedModelArrayField はフォームに表示されません。

Django MongoDB Backend currently supports all management commands not included in the following table. To view a full list of commands, see Available commands in the Django documentation.

Diango コマンド
現在のサポート

createcachetable

サポート対象外

dumpdata

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

inspectdb

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

loaddata

サポート対象外 。ただし、GA 以降のリリースでこの機能のサポートを追加する予定です。

Diango の機能
現在のサポート

移行コマンドによるインデックスの作成、削除、更新

部分的にサポートされています 。埋め込みモデルまたは配列フィールドのインデックスを更新することはできません。

サポート対象外

migrate --fake-initial オプション

サポート対象外

埋め込みモデルの移行

部分的にサポートされています 。移行コマンドは、埋め込みモデル フィールドまたは PolymorphicEmbeddedModelField または PolymorphicEmbeddedModelArrayField が参照する埋め込みモデルへの変更を検出しません。

ライブラリ
現在のサポート

Partially Supported. To learn more about the use cases and limitations of this library, see Django filter in the Django MongoDB CLI documentation.

Partially Supported. To learn more about the use cases and limitations of this library, see Django rest framework in the Django MongoDB CLI documentation.

Partially Supported. To learn more about the use cases and limitations of this library, see Django allauth in the Django MongoDB CLI documentation.

Partially Supported. To learn more about the use cases and limitations of this library, see Django debug toolbar in the Django MongoDB CLI documentation.

戻る

トランザクション