{"id":21326236,"url":"https://github.com/masylum/php_mongo","last_synced_at":"2026-01-02T15:42:44.333Z","repository":{"id":1248893,"uuid":"1187435","full_name":"masylum/php_mongo","owner":"masylum","description":"Tiny wrapper of the php mongo client","archived":false,"fork":false,"pushed_at":"2010-12-21T15:54:43.000Z","size":96,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T12:32:40.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/masylum.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":"2010-12-21T15:41:09.000Z","updated_at":"2013-10-10T07:11:30.000Z","dependencies_parsed_at":"2022-08-16T12:45:14.536Z","dependency_job_id":null,"html_url":"https://github.com/masylum/php_mongo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Fphp_mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Fphp_mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Fphp_mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masylum%2Fphp_mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masylum","download_url":"https://codeload.github.com/masylum/php_mongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806041,"owners_count":20350775,"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-21T21:08:53.398Z","updated_at":"2026-01-02T15:42:44.305Z","avatar_url":"https://github.com/masylum.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# php_mongo\n\nphp_mongo is a tiny wrapper for the php mongo client.\n\nIts based (I would say, a shameless copy) on [simplemongophp](http://github.com/ibwhite/simplemongophp)\n\n## how does it work?\n\nPHPMongo is not a ORM. Is just a bunch of static functions that only share the connection.\n\n    PHPMongo::connect(array(\n        user: 'xxxxx'\n        password: 'xxxxxx'\n        uri: foo.domain.com\n        port: 27031\n        db: 'db_name'\n    ));\n\n## examples\n\n    PHPMongo::find('cats')-\u003esort(array('order' =\u003e 1, 'name' =\u003e 1));\n\n    PHPMongo::group(\n        'cats',\n        array('dogs' =\u003e 1, 'order' =\u003e 1),\n        array('count' =\u003e 0),\n        \"function (obj, prev) { prev.count++; }\",\n        $conditions\n    );\n\n    PHPMongo::mapReduce(\n        'cat',\n        'function(){emit(\"max\", this.order);}',\n        'function(key, values){return Math.max.apply(Math, values);}'\n    )-\u003egetNext();\n\n    PHPMongo::distinct('dogs', 'foo.bar', array(\n        'foo' =\u003e false,\n        'bar' =\u003e false\n    ));\n\n    PHPMongo::findOne('ads', array('location.country.woeid' =\u003e (int)$woeid, 'confirmed' =\u003e true, 'banned' =\u003e false, 'deleted' =\u003e false));\n\n    PHPMongo::insert('contacts', array('foo' =\u003e 'bar'));\n\n    // etc...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasylum%2Fphp_mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasylum%2Fphp_mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasylum%2Fphp_mongo/lists"}