Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c651c22
transactions support
shimonewman Jul 14, 2025
b262c21
remove replica-set file
shimonewman Jul 14, 2025
619176f
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 14, 2025
ba11cba
cleanup
shimonewman Jul 15, 2025
fb832fa
Merge branch 'mongo-transactions' of https://github.com/utopia-php/da…
shimonewman Jul 21, 2025
72c903e
clenup
shimonewman Jul 21, 2025
8421a34
sync with feat-mongo-2
shimonewman Jul 21, 2025
8cd9ac4
updates
shimonewman Jul 21, 2025
b131e4e
Merge branch 'mongo-transactions' of https://github.com/utopia-php/da…
shimonewman Jul 21, 2025
142d167
updates
shimonewman Jul 21, 2025
e6b2bba
updates
shimonewman Jul 21, 2025
ec67b59
updates
shimonewman Jul 21, 2025
0895f84
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 24, 2025
1760ea5
sunc against upsert pr
shimonewman Jul 24, 2025
9edd05f
Update composer.lock and docker-compose.yml for dependency versions a…
shimonewman Jul 24, 2025
79020e6
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 27, 2025
85748b7
sync with feat-mongo-2
shimonewman Jul 27, 2025
4b24c13
sync with feat-mongo-2
shimonewman Jul 27, 2025
5bcf41e
Refactor MongoDB configuration in docker-compose and enhance transact…
shimonewman Jul 27, 2025
666affb
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 27, 2025
64fc966
Merge remote-tracking branch 'origin/mongo-transactions' into mongo-t…
shimonewman Jul 27, 2025
3848103
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 29, 2025
4b52755
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 29, 2025
3b50f31
Merge branch 'feat-mongo-2' of github.com:utopia-php/database into mo…
shimonewman Jul 29, 2025
f498894
Update docker-compose.yml to add a note about manual initiation of th…
shimonewman Jul 29, 2025
2b65727
Update src/Database/Adapter/Mongo.php
shimonewman Aug 3, 2025
c32f718
Merge branch 'feat-mongo-tmp' of github.com:utopia-php/database into …
shimonewman Sep 7, 2025
d0233d4
Merge remote-tracking branch 'origin/mongo-transactions' into mongo-t…
shimonewman Sep 7, 2025
5deab87
Merge branch 'feat-mongo-tmp' of github.com:utopia-php/database into …
shimonewman Sep 7, 2025
728e933
Update Key validator to restrict length to 36 characters for MongoDB …
shimonewman Sep 8, 2025
c0e8f88
Enhance documentation for Mongo adapter by adding parameter type hint…
shimonewman Sep 8, 2025
434dcd0
Merge branch 'feat-mongo-tmp' of github.com:utopia-php/database into …
shimonewman Sep 14, 2025
33fd387
Merge remote-tracking branch 'origin/mongo-transactions' into mongo-t…
shimonewman Sep 14, 2025
771cc7e
linter
shimonewman Sep 14, 2025
d5c909f
Merge branch 'mongo-transactions' of https://github.com/utopia-php/da…
shimonewman Sep 14, 2025
160c6f9
Update docker-compose.yml to enable MongoDB client mapping and enhanc…
shimonewman Sep 14, 2025
bc986b4
Merge branch 'feat-mongo-tmp' of github.com:utopia-php/database into …
shimonewman Sep 18, 2025
befe5be
Merge remote-tracking branch 'origin/mongo-transactions' into mongo-t…
shimonewman Sep 18, 2025
4e7f6ae
Merge remote-tracking branch 'origin/feat-mongo-tmp' into mongo-trans…
abnegate Sep 26, 2025
657f089
Fix tests
abnegate Sep 26, 2025
b05eb72
Refactor name
abnegate Sep 26, 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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"utopia-php/framework": "0.33.*",
"utopia-php/cache": "0.13.*",
"utopia-php/pools": "0.8.*",
"utopia-php/mongo": "0.6.0"
"utopia-php/mongo": "0.7.*"
},
"require-dev": {
"fakerphp/faker": "1.23.*",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 38 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ services:
- ./dev/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- /var/run/docker.sock:/var/run/docker.sock
- ./docker-compose.yml:/usr/src/code/docker-compose.yml
#- ./vendor/utopia-php/mongo/src/Client.php:/usr/src/code/vendor/utopia-php/mongo/src/Client.php
environment:
PHP_IDE_CONFIG: serverName=tests

Expand Down Expand Up @@ -85,35 +84,54 @@ services:
- MYSQL_ROOT_PASSWORD=password

mongo:
image: mongo:latest
image: mongo:8.0.14
container_name: utopia-mongo
entrypoint: ["/entrypoint.sh"]
networks:
- database
ports:
- "9706:27017"
volumes:
- mongo-data:/data/db
- ./tests/resources/mongo/mongo-keyfile:/tmp/keyfile:ro
- ./tests/resources/mongo/entrypoint.sh:/entrypoint.sh:ro
environment:
MONGO_INITDB_DATABASE: utopia_testing
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_USERNAME: user
MONGO_INITDB_PASSWORD: paswword
MONGO_INITDB_DATABASE: utopia_testing
healthcheck:
test: |
bash -c "
if mongosh -u root -p password --authenticationDatabase admin --quiet --eval 'rs.status().ok' 2>/dev/null; then
exit 0
else
mongosh -u root -p password --authenticationDatabase admin --quiet --eval \"
rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'localhost:27017'}]})
\" 2>/dev/null || exit 1
fi
"
interval: 10s
timeout: 10s
retries: 10
start_period: 30s

mongo-express:
image: mongo-express
container_name: mongo-express
depends_on:
mongo:
condition: service_healthy
networks:
- database
ports:
- "8083:8081"
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: password
ME_CONFIG_MONGODB_URL: mongodb://root:password@mongo:27017/?authSource=admin&directConnection=true
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: admin

mysql:
image: mysql:8.0.41
image: mysql:8.0.43
container_name: utopia-mysql
networks:
- database
Expand All @@ -129,7 +147,7 @@ services:
- SYS_NICE

mysql-mirror:
image: mysql:8.0.41
image: mysql:8.0.43
container_name: utopia-mysql-mirror
networks:
- database
Expand All @@ -145,20 +163,28 @@ services:
- SYS_NICE

redis:
image: redis:7.4.1-alpine3.20
image: redis:8.2.1-alpine3.22
container_name: utopia-redis
ports:
- "8708:6379"
networks:
- database

redis-mirror:
image: redis:7.4.1-alpine3.20
image: redis:8.2.1-alpine3.22
container_name: utopia-redis-mirror
ports:
- "8709:6379"
networks:
- database

volumes:
mongo-data:

networks:
database:

secrets:
mongo_keyfile:
file: ./tests/resources/mongo/mongo-keyfile

8 changes: 4 additions & 4 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1355,18 +1355,18 @@ abstract public function castingBefore(Document $collection, Document $document)
abstract public function castingAfter(Document $collection, Document $document): Document;

/**
* Is Mongo?
* Is internal casting supported?
*
* @return bool
*/
abstract public function isMongo(): bool;
abstract public function getSupportForInternalCasting(): bool;

/**
* Is internal casting supported?
* Is UTC casting supported?
*
* @return bool
*/
abstract public function getSupportForInternalCasting(): bool;
abstract public function getSupportForUTCCasting(): bool;

/**
* Set UTC Datetime
Expand Down
Loading