{"id":15405810,"url":"https://github.com/bestwebua/rom-mongo","last_synced_at":"2025-03-28T02:22:59.152Z","repository":{"id":40692161,"uuid":"506365480","full_name":"bestwebua/rom-mongo","owner":"bestwebua","description":"MongoDB adapter for ROM.","archived":false,"fork":false,"pushed_at":"2024-04-04T09:09:44.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T18:49:26.793Z","etag":null,"topics":["data-access-layer","data-mapping","hacktoberfest","mongo","mongodb","rom-rb","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestwebua.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-22T18:37:43.000Z","updated_at":"2022-10-06T09:06:14.000Z","dependencies_parsed_at":"2024-04-04T10:28:07.843Z","dependency_job_id":"9444828a-845f-4fda-a966-8dadfb04badb","html_url":"https://github.com/bestwebua/rom-mongo","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"5b0e9ade9027ff16c0fa70253f3c3978eaae1561"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestwebua%2From-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestwebua%2From-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestwebua%2From-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestwebua%2From-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestwebua","download_url":"https://codeload.github.com/bestwebua/rom-mongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245955780,"owners_count":20699972,"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":["data-access-layer","data-mapping","hacktoberfest","mongo","mongodb","rom-rb","ruby","ruby-gem"],"created_at":"2024-10-01T16:18:39.058Z","updated_at":"2025-03-28T02:22:58.430Z","avatar_url":"https://github.com/bestwebua.png","language":"Ruby","readme":"# MongoDB adapter for Ruby Object Mapper\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/5b38ebba392bd37f166b/maintainability)](https://codeclimate.com/github/bestwebua/rom-mongo/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/5b38ebba392bd37f166b/test_coverage)](https://codeclimate.com/github/bestwebua/rom-mongo/test_coverage)\n[![CircleCI](https://circleci.com/gh/bestwebua/rom-mongo/tree/master.svg?style=svg)](https://circleci.com/gh/bestwebua/rom-mongo/tree/master)\n[![Gem Version](https://badge.fury.io/rb/rom-mongodb.svg)](https://badge.fury.io/rb/rom-mongodb)\n[![Downloads](https://img.shields.io/gem/dt/rom-mongodb.svg?colorA=004d99\u0026colorB=0073e6)](https://rubygems.org/gems/rom-mongodb)\n[![GitHub](https://img.shields.io/github/license/bestwebua/rom-mongo)](LICENSE.txt)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n\n`rom-mongodb` - MongoDB adapter for [ROM](https://rom-rb.org). What is ROM? It's a fast ruby persistence library with the goal of providing powerful object mapping capabilities without limiting the full power of the underlying datastore.\n\n## Table of Contents\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Code of Conduct](#code-of-conduct)\n- [Credits](#credits)\n- [Versioning](#versioning)\n- [Changelog](CHANGELOG.md)\n\n## Requirements\n\nRuby MRI 2.5.0+\n\n## Installation\n\nAdd this line to your application's `Gemfile`:\n\n```ruby\ngem 'rom-mongodb'\n```\n\nAnd then execute:\n\n```bash\nbundle\n```\n\nOr install it yourself as:\n\n```bash\ngem install rom-mongodb\n```\n\n## Usage\n\n```ruby\n# Define your container with mongo adapter\n\nrequire 'mongo'\nrequire 'rom'\nrequire 'rom/mongo'\n\nconnection = Mongo::Client.new('mongodb://127.0.0.1:27017/your_db_name')\ncontainer = ROM.container(:mongo, connection) do |config|\n  config.relation(:users) do\n    schema(:users) do\n      attribute :_id, ROM::Types.Nominal(BSON::ObjectId)\n      attribute :email, ROM::Types::String\n      attribute :rating, ROM::Types::Integer\n      attribute :status, ROM::Types::Bool\n      attribute :orders?, ROM::Types::Array # optional attribute, if field does not exists will return nil\n    end\n  end\nend\n\n# Define your repository\n\nrequire 'rom/repository'\n\nUserRepository = ::Class.new(ROM::Repository[:users]) do\n  commands(:create, :delete, update: :by_pk)\n\n  def all\n    users.to_a\n  end\n\n  def find(**options)\n    users.find(options)\n  end\nend\n\nuser_repository = UserRepository.new(container)\n\n# Now you can do some manipulations with your repository\n\nuser_repository.create({ email: 'olo@domain.com', rating: 42, status: true })\nuser_repository.all\nuser_repository.find(email: 'olo@domain.com')\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at \u003chttps://github.com/bestwebua/rom-mongo\u003e. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/bestwebua/rom-mongo/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the rom-mongodb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).\n\n## Credits\n\n- [The Contributors](https://github.com/bestwebua/rom-mongo/graphs/contributors) for code and awesome suggestions\n- [The Stargazers](https://github.com/bestwebua/rom-mongo/stargazers) for showing their support\n\n## Versioning\n\nrom-mongodb uses [Semantic Versioning 2.0.0](https://semver.org)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestwebua%2From-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestwebua%2From-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestwebua%2From-mongo/lists"}