{"id":15705132,"url":"https://github.com/jnunemaker/toystore-mongo","last_synced_at":"2025-06-22T17:40:43.064Z","repository":{"id":1475026,"uuid":"1717501","full_name":"jnunemaker/toystore-mongo","owner":"jnunemaker","description":"Mongo integration for Toystore","archived":false,"fork":false,"pushed_at":"2012-12-28T21:56:15.000Z","size":168,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T18:09:17.440Z","etag":null,"topics":[],"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/jnunemaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-08T02:33:38.000Z","updated_at":"2016-05-30T15:49:58.000Z","dependencies_parsed_at":"2022-07-29T17:39:57.803Z","dependency_job_id":null,"html_url":"https://github.com/jnunemaker/toystore-mongo","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Ftoystore-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Ftoystore-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Ftoystore-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnunemaker%2Ftoystore-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnunemaker","download_url":"https://codeload.github.com/jnunemaker/toystore-mongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253795144,"owners_count":21965486,"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-10-03T20:14:50.286Z","updated_at":"2025-05-12T18:09:56.499Z","avatar_url":"https://github.com/jnunemaker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toystore Mongo\n\nMongo integration for Toystore.\n\n## Install\n\n```\ngem install toystore-mongo\n```\n\n## Usage\n\n```ruby\nclass User\n  include Toy::Mongo\n  adapter :mongo, Mongo::Connection.new.db('myapp')['users']\n\n  attribute :name, String\nend\n```\n\nIncluding Toy::Mongo includes Toy::Store and then does a few things:\n\n* Includes Plucky querying so you can do things like User.count, User.all, User.first, and much more\n* Sets the key factory to object id\n* Overrides get so that it also works with string representation of object id\n* Overrides get_multi so that it performs one query instead of one query per id\n\n\n### Atomic Updates\n\n```ruby\nclass User\n  include Toy::Mongo\n  include Toy::Mongo::AtomicUpdates\n\n  adapter :mongo_atomic, Mongo::Connection.new.db('adapter')['testing']\n\n  attribute :name, String\n  attribute :bio, String\nend\n\nuser = User.create(:name =\u003e 'John', :bio =\u003e 'Awesome!')\nuser.name = 'Nunes'\nuser.save # Equivalent to update({:_id =\u003e user.id}, {'$set' =\u003e {'name' =\u003e 'Nunes'}})\n```\n\nCaveat: At this time it only works with simple data types. Complex types like Hash, Array, and Set are not supported. Oddness will ensue if you expect them to work as they can be manipuled through means other than assignment.\n\n## Contributing\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a future version unintentionally.\n* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n## Copyright\n\nSee LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnunemaker%2Ftoystore-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnunemaker%2Ftoystore-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnunemaker%2Ftoystore-mongo/lists"}