filter

package
v0.0.0-...-ce71dfa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2012 License: BSD-2-Clause-Views Imports: 5 Imported by: 0

README

Filter

Biggest problems with this package currently:

  • set/mongodb dependency (an interface shouldn't rely on a particular implementation of an other interface)
  • Clone method not implemented
  • Too much magic in the processMap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Parents are separated from the query, because they are not used only at querying (FindOne, Find, Update, UpdateAll, Remove, RemoveAll), but at Insert too.

func New

func New(set iface.Set, hooks iface.Hooks, scheme, input map[string]interface{}) (*Filter, error)

func NewSimple

func NewSimple(set iface.Set, hooks iface.Hooks, scheme map[string]interface{}) (*Filter, error)

func (*Filter) AddParents

func (f *Filter) AddParents(fieldname string, a []iface.Id)

func (*Filter) AddQuery

func (f *Filter) AddQuery(q map[string]interface{}) iface.Filter

func (*Filter) Clone

func (f *Filter) Clone() iface.Filter

func (*Filter) Count

func (f *Filter) Count() (int, error)

func (*Filter) Find

func (f *Filter) Find() ([]map[string]interface{}, error)

func (*Filter) FindOne

func (f *Filter) FindOne() (map[string]interface{}, error)

func (*Filter) Ids

func (f *Filter) Ids() ([]iface.Id, error)

func (*Filter) Insert

func (f *Filter) Insert(d map[string]interface{}) error

func (*Filter) Iterate

func (f *Filter) Iterate(callback func(iface.Document) error) error

func (*Filter) Modifiers

func (f *Filter) Modifiers() iface.Modifiers

func (*Filter) Reduce

func (f *Filter) Reduce(a ...iface.Filter) (iface.Filter, error)

func (*Filter) Remove

func (f *Filter) Remove() error

func (*Filter) RemoveAll

func (f *Filter) RemoveAll() (int, error)

func (*Filter) SelectOne

func (f *Filter) SelectOne() (iface.Document, error)

func (*Filter) Subject

func (f *Filter) Subject() string

func (*Filter) Update

func (f *Filter) Update(upd_query map[string]interface{}) error

func (*Filter) UpdateAll

func (f *Filter) UpdateAll(upd_query map[string]interface{}) (int, error)

func (*Filter) Visualize

func (f *Filter) Visualize()

type Mods

type Mods struct {
	// contains filtered or unexported fields
}

func (*Mods) Limit

func (m *Mods) Limit() int

func (*Mods) Skip

func (m *Mods) Skip() int

func (*Mods) Sort

func (m *Mods) Sort() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL