{"id":19142186,"url":"https://github.com/eldoy/minimongo","last_synced_at":"2026-05-12T12:39:15.858Z","repository":{"id":56883905,"uuid":"77346233","full_name":"eldoy/minimongo","owner":"eldoy","description":"Tiny MongoDB Ruby library","archived":false,"fork":false,"pushed_at":"2017-07-12T14:59:35.000Z","size":25,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T12:46:50.813Z","etag":null,"topics":["mongodb","mongodb-driver","mongodb-orm","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/eldoy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-12-25T23:09:43.000Z","updated_at":"2023-08-06T15:02:25.000Z","dependencies_parsed_at":"2022-08-20T22:31:06.892Z","dependency_job_id":null,"html_url":"https://github.com/eldoy/minimongo","commit_stats":null,"previous_names":["fugroup/minimongo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fminimongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fminimongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fminimongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fminimongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/minimongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240223213,"owners_count":19767597,"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":["mongodb","mongodb-driver","mongodb-orm","ruby","ruby-gem"],"created_at":"2024-11-09T07:26:14.405Z","updated_at":"2026-05-12T12:39:10.834Z","avatar_url":"https://github.com/eldoy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimongo\nThe world's tiniest MongoDB Ruby library, only 6 lines of code. Nothing is faster than no code.\n\nIf you need models, have a look at [Modelize,](https://github.com/fugroup/modelize) it can be run on top of Minimongo.\n\nWe also have [Mongocore](https://github.com/fugroup/mongocore) if you're looking for a full ORM.\n\n### Installation\n```\ngem install minimongo\n```\nor add to Gemfile.\n\n### Usage\n```ruby\n# All commands supported\n# https://docs.mongodb.com/ruby-driver/master/quick-start\n\n# Connect\nMinimongo.db = Mongo::Client.new([ '127.0.0.1:27017' ], :database =\u003e \"minimongo_#{ENV['RACK_ENV']}\")\n\n# Include methods in a class or module\ninclude Minimongo::Query\n\n# Include as helper in a Sinatra app\nhelpers Minimongo::Query\n\n# Use with global variable\n$db = include Minimongo::Query\n$db.find(:messages).all\n\n# Find needs first, count or to_a after\nd = find(:domains).first\nd = find(:domains).sort(:duration =\u003e -1).to_a\nm = find(:messages, :_id =\u003e d._id).limit(1).first\nc = find(:messages).count\n\n# All\nm = all(:messages)\nm = all(:messages, :duration =\u003e {:$gt =\u003e 6})\n\n# First\nm = first(:models)\nm = first(:models, :goal =\u003e 7)\n\n# Last\nm = last(:models)\nm = last(:models, :duration =\u003e {:$ne =\u003e 6})\n\n# Count\nc = count(:messages)\nc = count(:messages, :goal =\u003e 'hello')\n\n# Insert\ninsert(:domains, :name =\u003e p[:name], :email =\u003e p[:email], :reply =\u003e p[:reply])\n\n# Update\nupdate(:domains, {:_id =\u003e p[:id]}, :name =\u003e p[:name], :email =\u003e p[:email])\n\n# Delete\ndelete(:domains, :_id =\u003e p[:id])\n\n# String as ID\nfind(:domains, '586333360aec08e87bd62180')\nfirst(:domains, '586333360aec08e87bd62180')\n\n# String to Object ID\noid('586333360aec08e87bd62180')\n\n# New Object ID\noid\noid(:new)\n\n```\n\nCreated and maintained by [Fugroup Ltd.](https://www.fugroup.net) We are the creators of [CrowdfundHQ.](https://crowdfundhq.com)\n\n`@authors: Vidar`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fminimongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Fminimongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fminimongo/lists"}