No release in over 3 years
Low commit activity in last 3 years
实现实体和标签间的N2N关系,对基于tag查询实体的单向优化
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8.0
~> 3.0.0
~> 1.5.1
~> 2.14.1

Runtime

~> 3.1.0
 Project Readme

粗糙的MONGOID TAG

设计目的:

  1. 不用动脑子想tag的设计
  2. 单向对基于tag查询实体的优化

基于以下假设

  1. 根据标签名称,查找实体的情况频繁于根据实体查找tags
  2. 实体间不共享一类 tag

用法

class Model
include Mongoid::Document
include EasyMongoidTag

field :bname, as: :book_name, type: String easy_tags :tests end book1 = Model.create(bname: ‘红楼梦’, :tests => [’曹雪芹 ’, ’ 高 鹗 ’]) book2 = Model.create(bname: ‘石头记’, :tests => [‘曹沾’, ‘高 鹗’]) book1.test_tags TestTag.find_by(title: ‘曹雪芹’) TestTag.search(‘曹’)