{"id":20463401,"url":"https://github.com/atiksoftware/php-class-db-mongodb","last_synced_at":"2025-07-12T07:33:14.187Z","repository":{"id":62489186,"uuid":"147418597","full_name":"atiksoftware/php-class-db-mongodb","owner":"atiksoftware","description":"PHP MongoDB database class","archived":false,"fork":false,"pushed_at":"2019-04-08T21:34:43.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T05:39:40.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/atiksoftware.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}},"created_at":"2018-09-04T21:02:38.000Z","updated_at":"2024-06-15T21:54:08.000Z","dependencies_parsed_at":"2022-11-02T11:00:47.474Z","dependency_job_id":null,"html_url":"https://github.com/atiksoftware/php-class-db-mongodb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/atiksoftware/php-class-db-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atiksoftware%2Fphp-class-db-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atiksoftware%2Fphp-class-db-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atiksoftware%2Fphp-class-db-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atiksoftware%2Fphp-class-db-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atiksoftware","download_url":"https://codeload.github.com/atiksoftware/php-class-db-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atiksoftware%2Fphp-class-db-mongodb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958135,"owners_count":23689006,"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":[],"created_at":"2024-11-15T13:10:59.306Z","updated_at":"2025-07-12T07:33:14.159Z","avatar_url":"https://github.com/atiksoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP MongoDB database class\n\nThis is php class for connect to mogodb with php. Its working on PHP.5 mongo and PHP.7 mongodb  \n\n----------\n## Installation\n\n### Using Composer\n\n```sh\ncomposer require atiksoftware/php-class-db-mongodb\n```\n\n```php\nrequire __DIR__.'/../vendor/autoload.php';\n\nuse Atiksoftware\\Database\\MongoDB;\n$db = new MongoDB();\n```\n#### _connect to server_\n```php\n$db-\u003econnect(\"mongodb://127.0.0.1:27017\", \"username\",\"password\");\n```\n#### _connect to Database_\n```php\n$db-\u003esetDatebase(\"public_swain_test\");\n```\n#### _connect to Collection_\n```php\n$db-\u003esetCollection(\"posts\");\n```\n\n#### _Select_\n```php\n$db\n    -\u003eorderBy([\"_id\" =\u003e 1])\n    -\u003eprojectBy([\"title.TR\" =\u003e 1])\n    -\u003elimit(1)\n    -\u003eskip(1)\n    -\u003eselect();\n```\n\n#### _Insert_\n```php\n$db-\u003einsert([ \"_id\" =\u003e \"ucak-0\", \"name\" =\u003e \"F-\".time() ]);\n$db-\u003einsert([\n    [ \"_id\" =\u003e \"ucak-1\", \"name\" =\u003e \"F-\".time() ],\n    [ \"_id\" =\u003e \"ucak-2\", \"name\" =\u003e \"F-\".time() ],\n    [ \"_id\" =\u003e \"ucak-3\", \"name\" =\u003e \"F-\".time() ],\n],true);\n```\n\n#### _Update_\n```php\n$db-\u003ewhen([\"_id\" =\u003e \"ucak-1\"])-\u003eupdate([\"name\" =\u003e \"F-\".time()],true);\n$db-\u003ewhen([\"_id\" =\u003e \"ucak-2\"])-\u003eupdate([\"name\" =\u003e \"F-\".time()],true);\n$db-\u003ewhen([\"_id\" =\u003e \"ucak-3\"])-\u003eupdate([\"name\" =\u003e \"F-\".time()],true);\n$db-\u003ewhen([\"_id\" =\u003e \"ucak-4\"])-\u003eupdate([\"name\" =\u003e \"F-\".time()],true);\n```\n\n#### _Remove_\n```php\n$db-\u003ewhen([\"age\" =\u003e ['$gt' =\u003e 20]])-\u003eremove();\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatiksoftware%2Fphp-class-db-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatiksoftware%2Fphp-class-db-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatiksoftware%2Fphp-class-db-mongodb/lists"}