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

Convert MongoDB tutorial to PHP Attributes #2079

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

GromNaN
Copy link
Contributor

@GromNaN GromNaN commented Nov 29, 2024

I replayed the tutorial to make sure it was still valid. A few updates (in comments).

api-platform/doctrine-odm is required but mapping.paths automatically contains ODM Document dir
Copy link
Contributor

@vinceAmstoutz vinceAmstoutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


mapping:
paths:
['%kernel.project_dir%/src/Entity', '%kernel.project_dir%/src/Document']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/
public $product;
#[ODM\Id(strategy: 'INCREMENT', type: 'int')]
private int $id;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding prop types.

core/mongodb.md Outdated Show resolved Hide resolved
Comment on lines -54 to +55
- MONGO_INITDB_DATABASE=api
- MONGO_INITDB_ROOT_USERNAME=api-platform
- MONGODB_INITDB_DATABASE=api
- MONGODB_INITDB_ROOT_USERNAME=api-platform
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing legacy env vars from the mongo docker image, with the new env vars that works with mongodb/mongodb-atlas-local and mongodb/mongodb-community-server.

@dunglas
Copy link
Member

dunglas commented Nov 30, 2024

Cool!

@dunglas dunglas merged commit 16881ee into api-platform:4.0 Nov 30, 2024
1 check passed
@dunglas
Copy link
Member

dunglas commented Nov 30, 2024

Thank you very much @GromNaN!

@GromNaN GromNaN deleted the mongodb-review branch November 30, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants