{"id":20816079,"url":"https://github.com/arillo/meteor-astronomy-softremove-behavior","last_synced_at":"2026-04-24T10:32:37.585Z","repository":{"id":32322419,"uuid":"35897671","full_name":"arillo/meteor-astronomy-softremove-behavior","owner":"arillo","description":"Softremove behavior for Meteor Astronomy","archived":false,"fork":false,"pushed_at":"2015-05-27T07:46:59.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-25T22:34:28.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/arillo.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":"2015-05-19T17:30:22.000Z","updated_at":"2015-05-21T08:15:03.000Z","dependencies_parsed_at":"2022-09-05T05:01:54.248Z","dependency_job_id":null,"html_url":"https://github.com/arillo/meteor-astronomy-softremove-behavior","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arillo/meteor-astronomy-softremove-behavior","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-astronomy-softremove-behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-astronomy-softremove-behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-astronomy-softremove-behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-astronomy-softremove-behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arillo","download_url":"https://codeload.github.com/arillo/meteor-astronomy-softremove-behavior/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arillo%2Fmeteor-astronomy-softremove-behavior/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32218985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-17T21:27:57.633Z","updated_at":"2026-04-24T10:32:37.546Z","avatar_url":"https://github.com/arillo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meteor Astronomy softremove behavior\n\n## About\nThis behavior adds to fields to the schema `removed` and `removedAt`. `removed` will be a boolean marked true and `removedAt` will be filled with the current date on document remove. If you want to softremove an element just call softRemove() instead of remove()\n\n## Usage\n\n```js\nvar post = new Post();\npost.softRemove();\nconsole.log(post.removed); // Prints out true if removed\nconsole.log(post.removedAt); // Prints out date of document removable\n```\n\nYou can also pass options for the removed and removedAt fields\n\n```js\nPost = Astronomy.Class({\n  name: 'Post',\n  collection: Posts,\n  fields: ['title'],\n  behaviors: {\n    'softremove': {\n      removedFieldName: 'deleted',\n      removedAtFieldName: 'deletedAt'\n    }\n  }\n});\n```\n\n## Events\n\nYou will get two events, one before ```beforesoftremove```  and one after ```aftersoftremove``` the object has been softremoved.\n\n**Notice:** currently you have to take care yourself of removing the softRemoved objects from your publish functions. You can do this by filtering via removed: false, like:\n\n```js\nMeteor.publish( 'posts',  function() {\n    Posts.find({},{removed: false});\n}\n```\n\n**TODO:**\n- Implement retrieval of query selector to omit removed items","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fmeteor-astronomy-softremove-behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farillo%2Fmeteor-astronomy-softremove-behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farillo%2Fmeteor-astronomy-softremove-behavior/lists"}