{"repo":"Meteor-Community-Packages/meteor-schema-index","free":true,"listed":false,"github":"https://github.com/Meteor-Community-Packages/meteor-schema-index","clone":"git clone https://github.com/Meteor-Community-Packages/meteor-schema-index.git","description":"Control some MongoDB indexing with schema options","language":"JavaScript","stars":38,"topics":["indexing","meteorjs","mongodb"],"license":"MIT","category":"data-pipelines","readme_excerpt":"aldeed:schema-index ========================= A Meteor package that allows you to control some MongoDB indexing from your SimpleSchema. Installation In your Meteor app directory, enter: Usage Use the index option to ensure a MongoDB index for a specific field: Set to 1 or true for an ascending index. Set to -1 for a descending index. Or you may set this to another type of specific MongoDB index, such as \"2d\" . Indexes work on embedded sub-documents as well. If you have created an index for a field by mistake and you want to remove or change it, set index to false : IMPORTANT: If you need to change anything about an index, you must first start the app with index: false to drop the old index, and then restart with the correct index properties. If a field has the unique option set to true , the MongoDB index will be a unique index as well. Then on the server, Collection2 will rely on MongoDB to check uniqueness of your field, which is more efficient than our custom checking. For the unique option to work, index must be true , 1 , or -1 . The error message for uniqueness is very generic. It's best to define your own using MyCollection.simpleSchema().messages() . The error type string is \"notUnique\". You can use the sparse option along with the index and unique options to tell MongoDB to build a sparse index. By default, MongoDB will only permit one document that lacks the indexed field. By setting the sparse option to true , the index will only contain entries for documents that ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Meteor-Community-Packages","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Meteor-Community-Packages/meteor-schema-index/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."}