timshannon / bolthold

BoltHold is an embeddable NoSQL store for Go types built on BoltDB
MIT License
643 stars 45 forks source link

Added Not() criterion modifier #52

Closed timshannon closed 5 years ago

timshannon commented 5 years ago

examples

bolthold.Where("Category").Not().In("food", "animal")
bolthold.Where("Tags").Not().IsNil()
bolthold.Where("Tags").Not().IsNil().And("Name").Not().RegExp(regexp.MustCompile("ea"))
bolthold.Where(bolthold.Key).Not().Eq(testData[4].Key)
bolthold.Where("Category").Not().Eq("food").And("Category").Not().Eq("animal").Index("Category")

We now unfortunately have an overlap with the Ne() and Not().Eq(), but it's not worth dropping the Ne operator and breaking backwards compatibility.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.07%) to 86.24% when pulling e52bb1c20b1edf6382248790ed868c309e581e37 on 51-NOT-query-modifier into eed35b7556710c9108bd536193dae1ecb91f16fa on master.