{"id":14969924,"url":"https://github.com/bertugfahriozer/ci4mongodblibrary","last_synced_at":"2025-10-26T10:31:31.905Z","repository":{"id":62493470,"uuid":"369269944","full_name":"bertugfahriozer/ci4mongodblibrary","owner":"bertugfahriozer","description":"CodeIgniter 4 MongoDB Library \u0026 Common Model","archived":false,"fork":false,"pushed_at":"2023-02-05T01:33:43.000Z","size":28,"stargazers_count":14,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T04:37:09.222Z","etag":null,"topics":["ci4","ci4-mongodb-library","codeigniter-mongodb","codeigniter4","codeigniter4-mongodb","codeigniter4-mongodb-library","mongo","mongodb"],"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/bertugfahriozer.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":"2021-05-20T16:21:11.000Z","updated_at":"2024-10-29T08:08:38.000Z","dependencies_parsed_at":"2023-02-18T21:00:30.811Z","dependency_job_id":null,"html_url":"https://github.com/bertugfahriozer/ci4mongodblibrary","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertugfahriozer%2Fci4mongodblibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertugfahriozer%2Fci4mongodblibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertugfahriozer%2Fci4mongodblibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertugfahriozer%2Fci4mongodblibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertugfahriozer","download_url":"https://codeload.github.com/bertugfahriozer/ci4mongodblibrary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238310342,"owners_count":19450841,"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":["ci4","ci4-mongodb-library","codeigniter-mongodb","codeigniter4","codeigniter4-mongodb","codeigniter4-mongodb-library","mongo","mongodb"],"created_at":"2024-09-24T13:42:41.731Z","updated_at":"2025-10-26T10:31:26.633Z","avatar_url":"https://github.com/bertugfahriozer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codeigniter 4 MongoDB Kitaplığı ve Ortak Model\n\n##Sistem Gereksinimleri\n\n- PHP 7.3 veya 8.0^\n- MongoDB PHP Driver 1.8^\n\n## Kurulum\n\nMongo Driver ve Composer'a sisteminize kurmuş olmalısınız. Kurulum için şu bağlantıları izleyin:\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos\"\u003eComposer kurulumu\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.php.net/manual/en/mongo.installation.php\"\u003eMongo sürücü kurulumu\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\nBir config dosyası oluşturmalısınız. Dosya oluşturduğunuzda, php etiketi için boşlukları silin. (app/Config/MongoConfig.php)\n\nUzak Bağlantı için srv değişkenine yorum satırındakini veri kullanılabilir veya boş bırakılabilir. authMechanism değişkeni bağlantı yapılırken gereken güvenlik protokolünü belirtmeniz için oluşturulmuştur.\n\nEğer isterseniz başka bir veritabanına bağlanmak için model içinde $dbVar=new Mongo('dbName'). bu sayede tek bir Ci4 uygulaması içinde birden çok veritabanına müdehale edebilirsiniz.\n\n``` php\n\u003c?php namespace App\\Config;\n\nuse CodeIgniter\\Config\\BaseConfig;\n\nclass MongoConfig extends BaseConfig\n{\n    public $dbInfo = [];\n\n    public function __construct()\n    {\n        $this-\u003edbInfo = [\n            'default' =\u003e (object)[\n                'db' =\u003e '', //your database\n                'hostname' =\u003e \"\",//127.0.0.1 if you use remote server you should change host address\n                'userName' =\u003e \"\",\n                'password' =\u003e \"\",\n                'prefix' =\u003e '',\n                'port' =\u003e \"\",//27017 if you use different port you should change port address\n                'srv' =\u003e 'mongodb',//mongodb+srv\n                //SCRAM-SHA-256 - SCRAM-SHA-1\n                'authMechanism' =\u003e \"SCRAM-SHA-1\",\n                'db_debug' =\u003e TRUE,\n                'write_concerns' =\u003e (int)1,\n                'journal' =\u003e TRUE,\n                'read_preference' =\u003e 'primary',\n                'read_concern' =\u003e 'local', //'local', 'majority' or 'linearizable'\n                'ca_file'=\u003e[]//['ca_file' =\u003e '/usr/local/etc/openssl/cert.pem']\n            ]\n        ];\n    }\n}\n```\n\n\u003ccode\u003ecomposer require bertugfahriozer/ci4mongodblibrary\u003c/code\u003e\n\nEğer Composer ile yükledikten sonra direkt devam etmek istiyorsanız namespace düzeni şu şekilde :\n\n\u003ccode\u003e\nuse ci4mongodblibrary\\Models\\CommonModel;\n\nuse ci4mongodblibrary\\Libraries\\Mongo;\n\u003c/code\u003e\n\n\u003chr\u003e\n\nManuel kurulum istiyorsanız aşağıdaki adımları takip edebilirsiniz.\n\n**Codeigniter 4 projenize dosyaları taşıyabilirsiniz ve namespace değiştirmeniz gerekir =\u003e\u003cbr\u003e\u003cbr\u003eapp/Libraries/Mongo.php,\u003cbr\u003eapp/Config/MongoConfig.php,\u003cbr\u003eapp/Models/CommonModel.php.**\n\n\u003ca href=\"http://www.bynogame.com/destekle/bertugfahriozer-wwwyoutubecomchannelUCnw4Gyax5OAx6d4DtiNh_gw\"\u003e\u003cimg src=\"https://bertugfahriozer.com/assets/images/gallery/BMC-logowordmark-Black.jpg\" height=\"70\"\u003e\u003c/a\u003e\n\u003chr\u003e\n\n# Codeigniter 4 MongoDB Library \u0026 Common Model\n\n##System Requirements\n\n- PHP 7.3 veya 8.0^\n- MongoDB PHP Driver 1.8^\n\n## Installation\nYou must have Mongo Driver and Composer. Follow these links for installation:\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos\"\u003eComposer installation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.php.net/manual/en/mongo.installation.php\"\u003eMongo driver installation\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\nYou must create a config file. When you create file, delete spaces for php tag. (app/Config/MongoConfig.php)\n\nFor Remote Connection, the data in the comment line can be used or left blank in the srv variable. The authMechanism variable is created to specify the required security protocol when connecting.\n\nIf you want to connect to another database, $dbVar=new Mongo('dbName') in the model. In this way, you can intervene in multiple databases within a single Ci4 application.\n``` php\n\u003c?php namespace App\\Config;\n\nuse CodeIgniter\\Config\\BaseConfig;\n\nclass MongoConfig extends BaseConfig\n{\n    public $dbInfo = [];\n\n    public function __construct()\n    {\n        $this-\u003edbInfo = [\n            'default' =\u003e (object)[\n                'db' =\u003e '', //your database\n                'hostname' =\u003e \"\",//127.0.0.1 if you use remote server you should change host address\n                'userName' =\u003e \"\",\n                'password' =\u003e \"\",\n                'prefix' =\u003e '',\n                'port' =\u003e \"\",//27017 if you use different port you should change port address\n                'srv' =\u003e 'mongodb',//mongodb+srv\n                //SCRAM-SHA-256 - SCRAM-SHA-1\n                'authMechanism' =\u003e \"SCRAM-SHA-1\",\n                'db_debug' =\u003e TRUE,\n                'write_concerns' =\u003e (int)1,\n                'journal' =\u003e TRUE,\n                'read_preference' =\u003e 'primary',\n                'read_concern' =\u003e 'local', //'local', 'majority' or 'linearizable'\n                'ca_file'=\u003e[]//['ca_file' =\u003e '/usr/local/etc/openssl/cert.pem']\n            ]\n        ];\n    }\n}\n```\n\n\u003ccode\u003ecomposer require bertugfahriozer/ci4mongodblibrary\u003c/code\u003e\n\nIf you want to continue directly after installing with Composer, the namespace layout is as follows:\n\n\u003ccode\u003e\nuse ci4mongodblibrary\\Models\\CommonModel;\n\nuse ci4mongodblibrary\\Libraries\\Mongo;\n\u003c/code\u003e\n\n\u003chr\u003e\n\nif do you want manual install you can follow these steps.\n\n**You can move files in your Codeigniter 4 project and you must change namespaces =\u003e \u003cbr\u003e\u003cbr\u003e app/Libraries/Mongo.php,\u003cbr\u003eapp/Config/MongoConfig.php,\u003cbr\u003eapp/Models/CommonModel.php.**\n\n\u003ca href=\"http://www.bynogame.com/destekle/bertugfahriozer-wwwyoutubecomchannelUCnw4Gyax5OAx6d4DtiNh_gw\"\u003e\u003cimg src=\"https://bertugfahriozer.com/assets/images/gallery/BMC-logowordmark-Black.jpg\" height=\"70\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertugfahriozer%2Fci4mongodblibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertugfahriozer%2Fci4mongodblibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertugfahriozer%2Fci4mongodblibrary/lists"}