Documentation ¶
Index ¶
- Constants
- func ConvertMongoToCouchbase(expression bson.D, fieldPath IndexFieldPath) (string, error)
- func CreateIndexQuery(bucket, scope, collection string, index Index, fieldPath IndexFieldPath) (string, error)
- func GenerateArrayFilterExpression(input string, isTypeFilter bool, condition string) string
- func GenerateCouchbaseArrayIndex(input string) string
- func GroupAndCombine(keys []Key, includeMissing bool) (string, error)
- func NavigatePath(path string, data map[string]interface{}) (string, bool)
- func NewMongo(db repo.IRepo, analyzer Analyzer) common.ISource[option.Options]
- func ProcessField(field string, value interface{}, fieldPath IndexFieldPath) (string, error)
- type Analyzer
- type Index
- type IndexFieldAnalyzer
- type IndexFieldPath
- type Key
- type Mongo
- func (m *Mongo) GetCouchbaseIndexesQuery(bucket string, scope string, collection string) ([]common.Index, error)
- func (m *Mongo) GetIndexes(ctx context.Context) ([]Index, error)
- func (m *Mongo) Init(opts *option.Options, documentKey common.ICBDocumentKey) error
- func (m *Mongo) StreamData(ctx context.Context, mChan chan map[string]interface{}) error
Constants ¶
View Source
const ( INCLUDE_MISSSING = " INCLUDE MISSING" ASC = " ASC" DESC = " DESC" )
Variables ¶
This section is empty.
Functions ¶
func ConvertMongoToCouchbase ¶
func ConvertMongoToCouchbase(expression bson.D, fieldPath IndexFieldPath) (string, error)
ConvertMongoToCouchbase Convert MongoDB partial filter expression to Couchbase WHERE clause
func CreateIndexQuery ¶
func CreateIndexQuery(bucket, scope, collection string, index Index, fieldPath IndexFieldPath) (string, error)
func GenerateCouchbaseArrayIndex ¶
GenerateCouchbaseArrayIndex generates a Couchbase array index expression from a given input pattern like "schedule[].special_flights[].flight".
func GroupAndCombine ¶
GroupAndCombine array fields are combined because only one array field can be indexed in a compound index
func NavigatePath ¶
NavigatePath initiates the recursive path check.
func ProcessField ¶
func ProcessField(field string, value interface{}, fieldPath IndexFieldPath) (string, error)
ProcessField Process individual field conditions
Types ¶
type Analyzer ¶
type Analyzer interface { Init(index []Index, documentKey common.ICBDocumentKey) AnalyzeData(data map[string]interface{}) GetCouchbaseQuery(bucket, scope, collection string) []common.Index }
func NewIndexFieldAnalyzer ¶
func NewIndexFieldAnalyzer() Analyzer
type IndexFieldAnalyzer ¶
type IndexFieldAnalyzer struct {
// contains filtered or unexported fields
}
func (*IndexFieldAnalyzer) AnalyzeData ¶
func (a *IndexFieldAnalyzer) AnalyzeData(data map[string]interface{})
func (*IndexFieldAnalyzer) GetCouchbaseQuery ¶
func (a *IndexFieldAnalyzer) GetCouchbaseQuery(bucket, scope, collection string) []common.Index
func (*IndexFieldAnalyzer) Init ¶
func (a *IndexFieldAnalyzer) Init(indexes []Index, documentKey common.ICBDocumentKey)
type IndexFieldPath ¶
IndexFieldPath is used to have array representation for a particular path example: k1.n1k1.n2k1 is path for field n2k1 in a document. n1k1 is an array, and it is represented as k1.n1k1[].n2k1.
func (IndexFieldPath) Get ¶
func (i IndexFieldPath) Get(key string) string
Click to show internal directories.
Click to hide internal directories.