From 5bab4b8a888228338c0f04338398f40aec37fc21 Mon Sep 17 00:00:00 2001 From: rustagir Date: Wed, 27 Mar 2024 15:42:34 -0400 Subject: [PATCH 1/2] DOCSP-36631: laravel feature compatibility --- docs/feature-compatibility.txt | 331 +++++++++++++++++++++++++++++++++ docs/index.txt | 1 + 2 files changed, 332 insertions(+) create mode 100644 docs/feature-compatibility.txt diff --git a/docs/feature-compatibility.txt b/docs/feature-compatibility.txt new file mode 100644 index 000000000..ca6ebdb27 --- /dev/null +++ b/docs/feature-compatibility.txt @@ -0,0 +1,331 @@ +.. _laravel-feature-compat: + +============================= +Laravel Feature Compatibility +============================= + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: php framework, odm, support + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Overview +-------- + +This guide describes the Laravel features that are supported by +the {+odm-long+}. This page discusses Laravel version 11.x feature +availability in the {+odm-short+}. + +The following sections contain tables that describe whether individual +features are available in {+odm-short+}. + +Database Features +----------------- + +.. list-table:: + :header-rows: 1 + + * - Eloquent Feature + - Availability + + * - Configuration + - ✓ + + * - Read/Write Connections + - Use :manual:`read preference ` instead. + + * - Multiple Database Connections + - ✓ + + * - Listening for Query Events + - ✓ + + * - Monitoring Cumulative Query Time + - ✓ + + * - Transactions + - ✓ See :ref:`laravel-transactions`. + + * - Command Line Interface (CLI) + - Use the :mdb-shell:`MongoDB Shell <>` (``mongosh``). + + * - Database Inspection + - *Unsupported* + + * - Database Monitoring + - *Unsupported* + +.. TODO Listening to query events: yes (to be checked) +.. TODO Monitoring cumulative query time: yes (to be checked) + +Query Features +-------------- + +The following Eloquent methods are not supported in {+odm-short+}: + +- ``toSql()`` +- ``toRawSql()`` +- ``whereColumn()`` +- ``orWhereColumn()`` +- ``whereFulltext()`` +- ``groupByRaw()`` +- ``orderByRaw()`` +- ``inRandomOrder()`` +- ``union()`` +- ``unionAll()`` +- ``havingRaw()`` +- ``having()`` +- ``havingBetween()`` +- ``orHavingRaw()`` +- ``whereIntegerInRaw()`` +- ``orWhereIntegerInRaw()`` +- ``whereIntegerNotInRaw()`` +- ``orWhereIntegerNotInRaw()`` + +.. list-table:: + :header-rows: 1 + + * - Eloquent Feature + - Availability + + * - Running Queries + - ✓ + + * - Chunking Results + - ✓ + + * - Aggregates + - ✓ + + * - Select Statements + - ✓ + + * - Raw Expressions + - *Unsupported* + + * - Joins + - *Unsupported* + + * - Unions + - *Unsupported* + + * - `Basic Where Clauses `__ + - ✓ + + * - `Additional Where Clauses `__ + - ✓ + + * - Logical Grouping + - ✓ + + * - `Advanced Where Clauses `__ + - ✓ + + * - `Subquery Where Clauses `__ + - *Unsupported* + + * - Ordering + - ✓ + + * - Random Ordering + - *Unsupported* + + * - Grouping + - Partially supported, use :ref:`Aggregation Builders `. + + * - Limit and Offset + - ✓ + + * - Conditional Clauses + - ✓ + + * - Insert Statements + - ✓ + + * - Auto-Incrementing IDs + - *Unsupported as MongoDB uses ObjectIDs* + + * - Upserts + - *Unsupported* + + * - Update Statements + - ✓ + + * - Updating JSON Columns + - *Unsupported* + + * - Increment and Decrement Values + - ✓ + + * - Debugging + - ✓ + +.. TODO Streaming Results Lazily: (to be checked) +.. TODO JSON Where Clauses: (to be checked) +.. TODO Full Text Where Clauses: to be checked +.. TODO Pessimistic Locking: (to be checked) + +Pagination Features +------------------- + +{+odm-short+} supports all Laravel pagination features. + + +Migration Features +------------------ + +{+odm-short+} supports all Laravel migration features, but the +implementation is specific to MongoDB's schemaless model. + +Seeding Features +---------------- + +{+odm-short+} supports all Laravel seeding features. + +Eloquent Features +----------------- + +.. list-table:: + :header-rows: 1 + + * - Eloquent Feature + - Availability + + * - Models + - ✓ + + * - UUID and ULID Keys + - ✓ + + * - Timestamps + - ✓ + + * - Retrieving Models + - ✓ + + * - Advanced Subqueries + - *Unsupported* + + * - Retrieving or Creating Models + - ✓ + + * - Retrieving Aggregates + - *Partially supported* + + * - Inserting and Updating Models + - ✓ + + * - Upserts + - *Unsupported, but you can use the createOneOrFirst() method* + + * - Deleting Models + - ✓ + + * - Soft Deleting + - ✓ + + * - Pruning Models + - ✓ + +.. tip:: + + To learn more, see the :ref:`laravel-eloquent-model-class` guide. + +.. TODO Replicating Models: to be checked +.. TODO Query Scopes: to be checked +.. TODO Comparing Models: to be checked +.. TODO Events: to be checked +.. TODO Using Closures: to be checked +.. TODO Observers: to be checked +.. TODO Muting Events: to be checked + +Eloquent Relationship Features +------------------------------ + +.. list-table:: + :header-rows: 1 + + * - Eloquent Feature + - Availability + + * - Defining Relationships + - ✓ + + * - Many-to-Many Relationships + - ✓ + + * - Polymorphic Relationships + - ✓ + + * - Dynamic Relationships + - ✓ + + * - Querying Relations + - ✓ + + * - Aggregating Related Models + - *Unsupported* + + * - Inserting and Updating Related Models + - ✓ + +.. tip:: + + To learn more, see the :ref:`laravel-eloquent-model-relationships` guide. + +.. TODO Eager Loading: to be checked +.. TODO Touching Parent Timestamps: to be checked + +Eloquent Collection Features +---------------------------- + +{+odm-short+} supports all Eloquent collection features. + +Eloquent Mutator Features +------------------------- + +.. list-table:: + :header-rows: 1 + + * - Eloquent Feature + - Availability + + * - Casts + - ✓ + + * - Array and JSON Casting + - ✓ You can store objects and arrays in MongoDB without serializing to JSON. + + * - Date Casting + - ✓ + + * - Enum Casting + - ✓ + + * - Encrypted Casting + - ✓ + + * - Custom Casts + - ✓ + +.. tip:: + + To learn more, see the :ref:`laravel-eloquent-model-class` guide. + +.. TODO Query Time Casting: to be checked + +.. TODO Eloquent Resource Features +.. TODO Eloquent Serialization Features + +Eloquent Model Factory Features +------------------------------- + +{+odm-short+} supports all Eloquent factory features. diff --git a/docs/index.txt b/docs/index.txt index febdb9371..6494e6747 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -22,6 +22,7 @@ Laravel MongoDB /queues /transactions /issues-and-help + /feature-compatibility /compatibility /upgrade From 499f72168fd614e3755defefc4e06557673a7807 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 28 Mar 2024 13:54:45 -0400 Subject: [PATCH 2/2] NR PR fixes 1 --- docs/feature-compatibility.txt | 28 ++-------------------------- docs/query-builder.txt | 2 ++ 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/docs/feature-compatibility.txt b/docs/feature-compatibility.txt index ca6ebdb27..b4f0406f3 100644 --- a/docs/feature-compatibility.txt +++ b/docs/feature-compatibility.txt @@ -22,7 +22,7 @@ Overview This guide describes the Laravel features that are supported by the {+odm-long+}. This page discusses Laravel version 11.x feature -availability in the {+odm-short+}. +availability in {+odm-short+}. The following sections contain tables that describe whether individual features are available in {+odm-short+}. @@ -63,9 +63,6 @@ Database Features * - Database Monitoring - *Unsupported* -.. TODO Listening to query events: yes (to be checked) -.. TODO Monitoring cumulative query time: yes (to be checked) - Query Features -------------- @@ -139,7 +136,7 @@ The following Eloquent methods are not supported in {+odm-short+}: - *Unsupported* * - Grouping - - Partially supported, use :ref:`Aggregation Builders `. + - Partially supported, use :ref:`Aggregation Builders `. * - Limit and Offset - ✓ @@ -168,11 +165,6 @@ The following Eloquent methods are not supported in {+odm-short+}: * - Debugging - ✓ -.. TODO Streaming Results Lazily: (to be checked) -.. TODO JSON Where Clauses: (to be checked) -.. TODO Full Text Where Clauses: to be checked -.. TODO Pessimistic Locking: (to be checked) - Pagination Features ------------------- @@ -239,14 +231,6 @@ Eloquent Features To learn more, see the :ref:`laravel-eloquent-model-class` guide. -.. TODO Replicating Models: to be checked -.. TODO Query Scopes: to be checked -.. TODO Comparing Models: to be checked -.. TODO Events: to be checked -.. TODO Using Closures: to be checked -.. TODO Observers: to be checked -.. TODO Muting Events: to be checked - Eloquent Relationship Features ------------------------------ @@ -281,9 +265,6 @@ Eloquent Relationship Features To learn more, see the :ref:`laravel-eloquent-model-relationships` guide. -.. TODO Eager Loading: to be checked -.. TODO Touching Parent Timestamps: to be checked - Eloquent Collection Features ---------------------------- @@ -320,11 +301,6 @@ Eloquent Mutator Features To learn more, see the :ref:`laravel-eloquent-model-class` guide. -.. TODO Query Time Casting: to be checked - -.. TODO Eloquent Resource Features -.. TODO Eloquent Serialization Features - Eloquent Model Factory Features ------------------------------- diff --git a/docs/query-builder.txt b/docs/query-builder.txt index 18f03a2e1..55b5762e4 100644 --- a/docs/query-builder.txt +++ b/docs/query-builder.txt @@ -172,6 +172,8 @@ Distinct can be combined with **where**: $spamComments = Comment::where('body', 'like', '%spam%')->get(); +.. _laravel-query-builder-aggregates: + **Aggregation** **Aggregations are only available for MongoDB versions greater than 2.2.x**