{"id":16889695,"url":"https://github.com/benoitc/couch_randomdoc","last_synced_at":"2025-04-12T02:21:36.201Z","repository":{"id":2070740,"uuid":"3009607","full_name":"benoitc/couch_randomdoc","owner":"benoitc","description":"simple couchdb module to add support of random document fetching.","archived":false,"fork":false,"pushed_at":"2012-02-23T09:44:43.000Z","size":96,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T10:07:20.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://refuge.io","language":"Erlang","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/benoitc.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":"2011-12-19T03:18:55.000Z","updated_at":"2020-01-21T11:10:57.000Z","dependencies_parsed_at":"2022-08-29T00:20:14.759Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/couch_randomdoc","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/benoitc%2Fcouch_randomdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fcouch_randomdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fcouch_randomdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fcouch_randomdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/couch_randomdoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505921,"owners_count":21115354,"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-13T16:58:26.082Z","updated_at":"2025-04-12T02:21:36.161Z","avatar_url":"https://github.com/benoitc.png","language":"Erlang","readme":"# couch_randomdoc\n\n\n`couch_randomdoc` is a simple couchdb module to add support of random\ndocument fetching. It allows you to fetch doc via teh HTTP Api, filter\nthem and even render them dirrently using a show function.\n\nIt's actually **supported by all the [refuge](http://refuge.io) projects**:\n\n- [refuge](https://github.com/refuge/refuge)\n- [rcouch](https://github.com/refuge/rcouch)\n- [rcouch_template](https://github.com/refuge/rcouch_template)\n\n**Note**: A port as an Apache Couchdb plugin is in progress.\n\n## HTTP API\n\nTo get a random doc do a GET to `/\u003cdb\u003e/_random_doc` .\n\nAll options od the couchdb DOC APII can be applied.\n\nAn optionna parameter `filter` allows you to filter random document you\nwant to return. a filter functions is just like changes filters:\n\n    GET /\u003cdb\u003e/_random_doc?filter=DesignName/FuncName\n\nThere are also builtin filters:\n\n- `_prefix`: prefix you want to filter, Pass the prefix using the\n  `prefix` parameter:\n\n        GET /\u003cdb\u003e/_random_doc?filter=_prefix\u0026prefix=someprefix\n\n- `_design_doc`: to only return design document\n\n- `_view`: get a random document from a view index. Pass the view name\n  uing the `view` parameter:\n\n        GET /\u003cdb\u003e/_random_doc?filter=_view\u0026view=DesignName/ViewName\n\n\n## SHOW function\n\nLike show function you may want to render your random documents\ndiffently:\n\n        GET /\u003cdb\u003e/_design/DesignName/_random/ShowFunction\n\n\nFunctions are put in the shows property of the design document like any\nshows functions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fcouch_randomdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Fcouch_randomdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fcouch_randomdoc/lists"}