Skip to content

Merge release 2.10.0 into 3.0.x #2722

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

Merged
merged 39 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1b4905e
Update supported branch config (#2678)
alcaeus Sep 21, 2024
6af8698
Fix CI job (#2681)
alcaeus Oct 1, 2024
e0754ef
Merge pull request #2682 from doctrine/2.9.x
alcaeus Oct 1, 2024
db07f53
Remove usage of deprecated driver functionality (#2680)
alcaeus Oct 1, 2024
ff90e9a
Bump doctrine/.github from 5.0.1 to 5.1.0 (#2679)
dependabot[bot] Oct 1, 2024
8ac8b3a
Fix dropping search index (#2689)
GromNaN Oct 14, 2024
fe0f1ff
Convert `@psalm-*` annotations to generic or `@phpstan-*` annotation …
GromNaN Oct 14, 2024
da17214
Search index mapping must be dynamic or specify a field mapping. (#2690)
GromNaN Oct 17, 2024
e9a8e78
Support mapping time series collections (#2687)
alcaeus Oct 21, 2024
e4c971f
Remove usage of deprecated ReadPreference::RP_* constants (#2693)
GromNaN Oct 22, 2024
0b05bf2
Run tests with PHP 8.4 (#2616)
GromNaN Nov 4, 2024
2748349
Fix handling of unmapped properties in proxy objects (#2698)
alcaeus Nov 18, 2024
9817735
Bump doctrine/.github from 5.1.0 to 5.3.0
dependabot[bot] Nov 25, 2024
7d1e5a9
Merge pull request #2701 from doctrine/dependabot/github_actions/doct…
SenseException Nov 25, 2024
a860bab
Bump doctrine/.github from 5.3.0 to 6.0.0
dependabot[bot] Dec 2, 2024
c4b43c2
Merge pull request #2703 from doctrine/dependabot/github_actions/doct…
SenseException Dec 3, 2024
9d91047
doc: Fix simple search engine cookbook
beerswt Dec 13, 2024
a59a483
doc: Simplify simple search engine cookbook example
bikusta Dec 13, 2024
09641e5
Remove constructor
GromNaN Dec 13, 2024
1c57a0c
Merge pull request #2706 from bikusta/simple-search-engine-array
SenseException Dec 15, 2024
43514ef
Bump doctrine/.github from 6.0.0 to 7.1.0
dependabot[bot] Dec 16, 2024
7d6d710
Merge pull request #2707 from doctrine/dependabot/github_actions/doct…
greg0ire Dec 16, 2024
4d2e51a
Update BSON PHP Link (#2708)
rickogden Dec 16, 2024
ad7827c
Replace `wrapTransversable` generators to prevent memory leaks (#2709)
GromNaN Dec 19, 2024
dc306ed
Merge branch '2.10.x' into 2.9.x-merge-up-into-2.10.x_xBlWiFM2
GromNaN Dec 19, 2024
25ef253
Merge pull request #2710 from doctrine/2.9.x-merge-up-into-2.10.x_xBl…
GromNaN Dec 19, 2024
bf9f889
Use short urls for all php.net links (#2711)
GromNaN Dec 19, 2024
27002d1
Install latest python version to fix CI (#2714)
alcaeus Jan 10, 2025
0b9c1c7
Fix discriminatorValue key 0 (#2716)
parada85 Jan 17, 2025
8f0b370
Relax final constrain on stage classes (#2717)
GromNaN Jan 17, 2025
6be1b86
Merge branch '2.10.x' into 2.9.x-merge-up-into-2.10.x_lOGTcPMg
GromNaN Jan 17, 2025
5f2cbc4
Merge pull request #2718 from doctrine/2.9.x-merge-up-into-2.10.x
GromNaN Jan 17, 2025
f78c67c
Ensure compatibility with persistence 4
greg0ire Jul 6, 2024
f2f920e
Merge pull request #2696 from greg0ire/persistence-4-compat
greg0ire Jan 21, 2025
d726f05
Improve query and aggregator classes (#2702)
alcaeus Jan 21, 2025
336a70e
Switch proxies to `LazyGhostTrait` (#2700)
GromNaN Jan 22, 2025
d1dbffe
Keep proxy-manager by default (#2720)
GromNaN Jan 23, 2025
a00f135
Create website schema validation workflow (#2721)
SenseException Jan 23, 2025
434b6ec
Merge remote-tracking branch 'upstream/3.0.x' into 2.10.x-merge-up-in…
GromNaN Jan 24, 2025
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
19 changes: 14 additions & 5 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@
"docsSlug": "doctrine-mongodb-odm",
"versions": [
{
"name": "2.9",
"branchName": "2.9.x",
"name": "2.10",
"branchName": "2.10.x",
"slug": "latest",
"upcoming": true,
"aliases": [
"2.10.x"
]
},
{
"name": "2.9",
"branchName": "2.9.x",
"slug": "2.9",
"current": true,
"aliases": [
"current",
"stable",
"2.9.x"
]
},
{
"name": "2.8",
"branchName": "2.8.x",
"slug": "2.8",
"current": true,
"maintained": false,
"aliases": [
"current",
"stable",
"2.8.x"
]
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.1.0"
32 changes: 22 additions & 10 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
mongodb-version:
- "7.0"
- "6.0"
Expand All @@ -33,6 +34,8 @@ jobs:
- "highest"
symfony-version:
- "stable"
proxy:
- "lazy-ghost"
include:
# Test against lowest dependencies
- dependencies: "lowest"
Expand All @@ -41,27 +44,39 @@ jobs:
driver-version: "1.17.0"
topology: "server"
symfony-version: "stable"
proxy: "lazy-ghost"
# Test with highest dependencies
- topology: "server"
php-version: "8.2"
mongodb-version: "7.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "7"
proxy: "lazy-ghost"
# Test with a 5.0 replica set
- topology: "replica_set"
php-version: "8.2"
mongodb-version: "5.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "stable"
# Test with a 5.0 sharded cluster
- topology: "sharded_cluster"
php-version: "8.2"
proxy: "lazy-ghost"
# Test with ProxyManager
- php-version: "8.2"
mongodb-version: "5.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "stable"
proxy: "proxy-manager"
# Test with a 5.0 sharded cluster
# Currently disabled due to a bug where MongoDB reports "sharding status unknown"
# - topology: "sharded_cluster"
# php-version: "8.2"
# mongodb-version: "5.0"
# driver-version: "stable"
# dependencies: "highest"
# symfony-version: "stable"
# proxy: "lazy-ghost"

steps:
- name: "Checkout"
Expand Down Expand Up @@ -104,8 +119,6 @@ jobs:
if: "${{ matrix.symfony-version == '7' }}"
run: |
composer config minimum-stability dev
# not yet ready for v7
composer remove --no-update --dev vimeo/psalm
# update symfony deps
composer require --no-update symfony/console:^7@dev
composer require --no-update symfony/var-dumper:^7@dev
Expand All @@ -117,12 +130,10 @@ jobs:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v4
- name: "Install latest Python version"
uses: actions/setup-python@v5
with:
name: "composer-lock-phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ matrix.mongodb-version }}"
path: composer.lock
overwrite: true
python-version: '3.13'

- id: setup-mongodb
uses: mongodb-labs/drivers-evergreen-tools@master
Expand All @@ -134,3 +145,4 @@ jobs:
run: "vendor/bin/phpunit"
env:
DOCTRINE_MONGODB_SERVER: ${{ steps.setup-mongodb.outputs.cluster-uri }}
USE_LAZY_GHOST_OBJECTS: ${{ matrix.proxy == 'lazy-ghost' && '1' || '0' }}"
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@7.1.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,3 @@ jobs:

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=github"

static-analysis-psalm:
name: "Static Analysis with Psalm"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "8.2"

steps:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "mongodb"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"

- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v4
with:
name: "composer-lock-static-analysis-psalm"
path: composer.lock
overwrite: true

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"
21 changes: 21 additions & 0 deletions .github/workflows/website-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

name: "Website config validation"

on:
pull_request:
branches:
- "*.x"
paths:
- ".doctrine-project.json"
- ".github/workflows/website-schema.yml"
push:
branches:
- "*.x"
paths:
- ".doctrine-project.json"
- ".github/workflows/website-schema.yml"

jobs:
json-validate:
name: "Validate JSON schema"
uses: "doctrine/.github/.github/workflows/website-schema.yml@7.1.0"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ vendor/
.phpunit.cache
.phpunit.result.cache
phpcs.xml
psalm.xml
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
"doctrine/collections": "^1.5 || ^2.0",
"doctrine/event-manager": "^1.0 || ^2.0",
"doctrine/instantiator": "^1.1 || ^2",
"doctrine/persistence": "^3.2",
"doctrine/persistence": "^3.2 || ^4",
"friendsofphp/proxy-manager-lts": "^1.0",
"jean85/pretty-package-versions": "^1.3.0 || ^2.0.1",
"mongodb/mongodb": "^1.17.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0",
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0"
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
"symfony/var-exporter": "^6.2 || ^7.0"
},
"require-dev": {
"ext-bcmath": "*",
Expand All @@ -47,8 +48,7 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^10.4",
"squizlabs/php_codesniffer": "^3.5",
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
"vimeo/psalm": "~5.24.0"
"symfony/cache": "^5.4 || ^6.0 || ^7.0"
},
"conflict": {
"doctrine/annotations": "<1.12 || >=3.0"
Expand Down
20 changes: 7 additions & 13 deletions docs/en/cookbook/simple-search-engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Simple Search Engine

It is very easy to implement a simple keyword search engine with MongoDB. Because of
its flexible schema less nature we can store the keywords we want to search through directly
on the document. MongoDB is capable of indexing the embedded documents so the results are fast
on the document. MongoDB is capable of indexing an array field, so the results are fast
and scalable.

Sample Model: Product
Expand All @@ -25,15 +25,9 @@ setup a document like the following with a ``$keywords`` property that is mapped
#[Field(type: 'string')]
public string $title;

/** @var Collection<string> */
#[Field(type: 'collection')]
#[Index]
public Collection $keywords;

public function __construct()
{
$this->keywords = new ArrayCollection();
}
public array $keywords = [];
}

Working with Keywords
Expand All @@ -47,11 +41,11 @@ Now, create a product and add some keywords:

$product = new Product();
$product->title = 'Nike Air Jordan 2011';
$product->keywords->add('nike shoes');
$product->keywords->add('jordan shoes');
$product->keywords->add('air jordan');
$product->keywords->add('shoes');
$product->keywords->add('2011');
$product->keywords[] = 'nike shoes';
$product->keywords[] = 'jordan shoes';
$product->keywords[] = 'air jordan';
$product->keywords[] = 'shoes';
$product->keywords[] = '2011';

$dm->persist($product);
$dm->flush();
Expand Down
Loading