{"id":20540553,"url":"https://github.com/utopia-php/mongo","last_synced_at":"2025-07-17T12:35:06.912Z","repository":{"id":60723178,"uuid":"536473493","full_name":"utopia-php/mongo","owner":"utopia-php","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-10T09:49:23.000Z","size":108,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-10T17:48:59.541Z","etag":null,"topics":["hacktoberfest","php","utopia"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/utopia-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-14T08:00:57.000Z","updated_at":"2024-05-21T06:58:33.000Z","dependencies_parsed_at":"2024-05-21T07:52:06.389Z","dependency_job_id":null,"html_url":"https://github.com/utopia-php/mongo","commit_stats":{"total_commits":67,"total_committers":4,"mean_commits":16.75,"dds":"0.13432835820895528","last_synced_commit":"b6dfb31b93c07c59b8bbd62a3b52e3b97a407c09"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/utopia-php/mongo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fmongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fmongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fmongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fmongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utopia-php","download_url":"https://codeload.github.com/utopia-php/mongo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utopia-php%2Fmongo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264676674,"owners_count":23648114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","php","utopia"],"created_at":"2024-11-16T01:16:12.382Z","updated_at":"2025-07-17T12:35:06.885Z","avatar_url":"https://github.com/utopia-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Non-Blocking PHP Line Protocol Client for MongoDB\n\n[![Build Status](https://travis-ci.com/utopia-php/system.svg?branch=main)](https://travis-ci.com/utopia-php/mongo)\n![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/mongo.svg)\n[![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord)\n\nA non-blocking PHP client based on the line protocol for MongoDB. Designed to work well in async PHP environments like [Swoole](https://github.com/swoole/swoole-src) \nThis library is aiming to be as simple and easy to learn and use. \nThis library is maintained by the [Appwrite team](https://appwrite.io).\n\n## Getting Started\n\nInstall using composer:\n```bash\ncomposer require utopia-php/mongo\n```\n\nInit in your application:\n```php\n\u003c?php\n\n$client = new Client('testing', 'mongo', 27017, 'root', 'example', false);\n$client-\u003econnect();\n\n// drop database\n$client-\u003edropDatabase([]);\n\n// Create a new collection\n$client-\u003ecreateCollection('movies');\n\n// Get the list of databases\n$client-\u003elistDatabaseNames()-\u003edatabases;\n\n// insert a new document\n$document = $client-\u003einsert('movies', [\n        'name' =\u003e 'Armageddon 1',\n        'country' =\u003e 'USA',\n        'language' =\u003e 'English'\n    ]\n);\n\n$id = (string)$document['_id'];\n// Find Document with ObjectId\n$client-\u003efind('movies', ['_id' =\u003e new ObjectId($id)])-\u003ecursor-\u003efirstBatch ?? [];\n\n// insert a new document with specific id\n$id = 999;\n$client-\u003einsert('movies', [\n        'name' =\u003e 'Armageddon 2',\n        '_id' =\u003e $id,\n        'array' =\u003e ['USA', 'UK', 'India'],\n        'language' =\u003e 'English',\n        'float' =\u003e 9.9,\n        'integer' =\u003e 9,\n        'is_open' =\u003e true,\n        'date_string' =\u003e (new \\DateTime())-\u003eformat('Y-m-d\\TH:i:s.vP'),\n    ]\n);\n\n// Find document by id\n$client-\u003efind('movies', ['_id' =\u003e $id])-\u003ecursor-\u003efirstBatch ?? [];\n\n// Find documents by field\n$client-\u003efind('movies', ['name' =\u003e 'Armageddon'])-\u003ecursor-\u003efirstBatch ?? [];\n\n// Delete a document\n$client-\u003edelete('movies', ['_id' =\u003e $id]);\n\n// drop a collections\n$client-\u003edropCollection('movies');\n\n```\n\n## System Requirements\n\nUtopia Mongo client requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.\n\n## Copyright and license\n\nThe MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fmongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futopia-php%2Fmongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopia-php%2Fmongo/lists"}