{"repo":"Meteor-Community-Packages/denormalize","free":true,"listed":false,"github":"https://github.com/Meteor-Community-Packages/denormalize","clone":"git clone https://github.com/Meteor-Community-Packages/denormalize.git","description":"Simple denormalization for Meteor","language":"JavaScript","stars":20,"topics":["meteor","mongodb","grapher","denormalization","caching"],"license":"MIT","category":"data-pipelines","readme_excerpt":"Denormalize Simple denormalization for Meteor - Introduction - Collection.cache - Collection.cacheCount - Collection.cacheField - Migration - Nested referenceFields - Recursive caching - When are the caches updated? - Testing the package Introduction In this readme, parent always refers to the documents in which the cache is stored, while child refers to the documents that will be cached. Example: You have two collections - Users and Roles. The Users store the id of any Roles they have been assigned. If you want each User to cache information from any Roles that are assigned to it, the Users would be the parents and the Roles would be the children , and it would be either a one or many relationship, depending on if a User can have multiple Roles. If you wanted each Role to store a list of all Users which have that role, the Roles would be the parents and the Users would be the children , and it would be an inverse or many-inverse relationship. Collection.cache(options) Property Valid values Description type 'one', 'many', 'inverse' or 'many-inverse' one: The parent stores a single child id many: The parent stores an array of child ids inverse: Each child stores a single parent id many-inverse: Each child stores an array of parent ids collection Mongo.Collection The \"child collection\", from which docs will be cached fields Array of Strings or Object The fields to include in the cache. It can either look like ['username', 'profile.email'] or {username:1, profile:{email:1}} . Fo","default_branch":null,"files":null,"tree":[],"storefront":"/r/Meteor-Community-Packages","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Meteor-Community-Packages/denormalize/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}