🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/ypeckstadt/hyperledger-fabric-couchdb-query-builder-golang

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ypeckstadt/hyperledger-fabric-couchdb-query-builder-golang

v0.0.0-20190220080135-3e3c38babbce
Source
Go
Version published
Created
Source

CouchDB query builder for use with Hyperledger Fabric

builder := New()

	root := builder.AddCombination(OR, Filter{Field:"id", Value:5},Filter{Field:"ids", Value:10})
	levelOne := root.AddCombination(AND,Filter{Field:"a", Value:1},Filter{Field:"b", Value:2})
	levelOne.AddCombination(OR, Filter{Field:"x", Value:0},Filter{Field:"x", Value:100})

	query, err := builder.
		SetDocType("items").
		SetLimit(10).
		SetSkip(20).
		AddField("fieldOne").
		AddField("fieldTwo").
		AddField("fieldThree", "fieldFour").
		AddField("fieldFive").
		AddFilter("id", []int{1,2,3}).
		AddFilter("name", "peckstadt").
		AddFilter("categories", []string{"a","b"}).
		AddFilter("singleID", 1).
		AddCondition("testFieldForCondition", GreaterThanCondition{Value:1}).
		AddCondition("testFieldForCondition", GreaterThanOrEqualCondition{Value:1}).
		AddCondition("testFieldForCondition", LessThanCondition{Value:1}).
		AddCondition("testFieldForCondition", LessThanOrEqualCondition{Value:1}).
		AddCondition("testFieldForCondition", EqualCondition{Value:"1"}).
		AddCondition("testFieldForCondition", NotEqualCondition{Value:1}).
		AddSort("docType", "desc").
		AddSort("createdAt", "desc").
		Build()

FAQs

Package last updated on 20 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts