dbutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleQueryBuilder

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

SimpleQueryBuilder is a simple MongoDB query builder.

func (*SimpleQueryBuilder) Build

func (q *SimpleQueryBuilder) Build() bson.M

Build returns the result of the query builder as a bson.M. If Build() is called on a nil value it returns an empty bson.M that would match all documents.

func (*SimpleQueryBuilder) String

func (q *SimpleQueryBuilder) String() string

func (*SimpleQueryBuilder) Where

func (q *SimpleQueryBuilder) Where(key string, operator string, value interface{}) *SimpleQueryBuilder

Where matches MongoDB documents where key matches value using operator. If Where overwrites any other "where clause" that used the same key and operator.

func (*SimpleQueryBuilder) WhereIn

func (q *SimpleQueryBuilder) WhereIn(key string, value interface{}) *SimpleQueryBuilder

WhereIn searches from MongoDB documents where the value of key is in a list of values. WhereIn addes value to this list of queried values.

Jump to

Keyboard shortcuts

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